Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github 2/workflows/koyeb-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build and deploy backend to preview

on:
workflow_dispatch:
pull_request:
types: [synchronize, labeled]

jobs:
deploy:
concurrency:
group: '${{ github.ref_name }}'
cancel-in-progress: true
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'deploy-preview')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and configure the Koyeb CLI
uses: koyeb-community/koyeb-actions@v2
with:
api_token: '${{ secrets.KOYEB_PREVIEW_TOKEN }}'
- name: Build and deploy to Koyeb preview
run: |
koyeb deploy . platform-koyeb-preview/main \
--instance-type nano \
--region was \
--archive-builder docker \
--archive-docker-dockerfile remote.Dockerfile \
--privileged \
--type web \
--port 3001:http \
--route /:3001 \
--wait \
--env CLIENT_ID=${{secrets.CLIENT_ID}} \
--env CLIENT_SECRET=${{secrets.CLIENT_SECRET}} \
--env OAUTH_DATABASE_URL=${{secrets.PREVIEW_OAUTH_DATABASE_URL}} \
--env SERVER_HOST=${{vars.KOYEB_PREVIEW_SERVER_HOST}} \
--env NEON_API_HOST=${{vars.NEON_API_HOST_STAGING}} \
--env UPSTREAM_OAUTH_HOST=${{vars.OAUTH_HOST_STAGING}} \
--env COOKIE_SECRET=${{secrets.COOKIE_SECRET}} \

- name: Comment on PR with deployment URL
if: ${{ github.event_name == 'pull_request' && success() }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// GitHub bot id taken from (https://api.github.com/users/github-actions[bot])
const githubActionsBotId = 41898282

const ownerRepoParams = {
owner: context.repo.owner,
repo: context.repo.repo,
}

// Hidden start marker for the comment
const startMarker = '<!-- Preview Deployment Comment-->';
const body = `${startMarker}
🚀 Preview deployment ready: [https://preview-mcp.neon.tech](https://preview-mcp.neon.tech)`;

const comments = await github.paginate(github.rest.issues.listComments, {
...ownerRepoParams,
issue_number: context.issue.number,
});

// Delete previous comments regarding preview deployments.
for (comment of comments.filter(comment => comment.user.id === githubActionsBotId && comment.body.startsWith(startMarker))) {
await github.rest.issues.deleteComment({
comment_id: comment.id,
...ownerRepoParams,
})
}

await github.rest.issues.createComment({
...ownerRepoParams,
issue_number: context.issue.number,
body
});
42 changes: 42 additions & 0 deletions .github 2/workflows/koyeb-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and deploy backend to production

on:
workflow_dispatch:
push:
branches:
- 'main'

jobs:
deploy:
concurrency:
group: '${{ github.ref_name }}'
cancel-in-progress: true
runs-on: ubuntu-latest
# Only main branch is allowed to deploy to production
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and configure the Koyeb CLI
uses: koyeb-community/koyeb-actions@v2
with:
api_token: '${{ secrets.KOYEB_PROD_TOKEN }}'
- name: Build and deploy to Koyeb production
run: |
koyeb deploy . platform-${{ github.ref_name }}/main \
--instance-type medium \
--region was \
--archive-builder docker \
--archive-docker-dockerfile remote.Dockerfile \
--privileged \
--type web \
--port 3001:http \
--route /:3001 \
--wait \
--env CLIENT_ID=${{secrets.PROD_CLIENT_ID}} \
--env CLIENT_SECRET=${{secrets.PROD_CLIENT_SECRET}} \
--env OAUTH_DATABASE_URL=${{secrets.PROD_OAUTH_DATABASE_URL}} \
--env SERVER_HOST=${{vars.PROD_SERVER_HOST}} \
--env NEON_API_HOST=${{vars.PROD_NEON_API_HOST}} \
--env UPSTREAM_OAUTH_HOST=${{vars.PROD_OAUTH_HOST}} \
--env COOKIE_SECRET=${{secrets.COOKIE_SECRET}} \
30 changes: 30 additions & 0 deletions .github 2/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint and Build

on:
pull_request:
branches:
- main

jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: .bun-version
- name: Install root dependencies
run: bun install --frozen-lockfile
- name: Install landing dependencies
working-directory: landing
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Build
run: bun run build
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
[![npm downloads](https://img.shields.io/npm/dt/@neondatabase/mcp-server-neon)](https://www.npmjs.com/package/@neondatabase/mcp-server-neon)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/neondatabase/mcp-server-neon)](https://archestra.ai/mcp-catalog/neondatabase__mcp-server-neon)

The Model Context Protocol (MCP) is a [new, standardized protocol](https://modelcontextprotocol.io/introduction) designed to manage context between large language models (LLMs) and external systems. This repository offers an installer and an MCP Server for [Neon](https://neon.tech).

Neon's MCP server acts as a bridge between natural language requests and the [Neon API](https://api-docs.neon.tech/reference/getting-started-with-neon-api). Built upon MCP, it translates your requests into the necessary API calls, enabling you to manage tasks such as creating projects and branches, running queries, and performing database migrations seamlessly.
Expand Down