@neondatabase/mcp-server-neon
Advanced tools
Comparing version 0.1.6 to 0.1.7-beta.1
@@ -23,3 +23,20 @@ import { log } from 'console'; | ||
type: 'object', | ||
properties: {}, | ||
properties: { | ||
cursor: { | ||
type: 'string', | ||
description: 'Specify the cursor value from the previous response to retrieve the next batch of projects.', | ||
}, | ||
limit: { | ||
type: 'number', | ||
description: 'Specify a value from 1 to 400 to limit number of projects in the response.', | ||
}, | ||
search: { | ||
type: 'string', | ||
description: 'Search by project name or id. You can specify partial name or id values to filter results.', | ||
}, | ||
orgId: { | ||
type: 'string', | ||
description: 'Search for projects by org_id.', | ||
}, | ||
}, | ||
}, | ||
@@ -182,16 +199,50 @@ }, | ||
{ | ||
name: 'start_database_migration', | ||
description: `Start a database migration, use this tool for any DDL changes to your database. | ||
After the migration is applied, these information will be available: | ||
Migration Details: | ||
- Migration ID | ||
- Temporary Branch Name | ||
- Temporary Branch ID | ||
- Migration Result | ||
name: 'prepare_database_migration', | ||
description: ` | ||
<use_case> | ||
This tool should be used to perform schema migrations such as creating | ||
tables, adding columns, renaming columns or any other DDL changes. | ||
</use_case> | ||
With that information, it must: | ||
1. Use 'run-sql' tool to verify changes on the temporary branch | ||
2. Ask the users if he wants to commit this migration to the main branch using this migration ID: <migration_id> (show the migration ID in the prompt) | ||
3. End chat here - never commit the migration, only ask the user if he wants to commit it. | ||
<workflow> | ||
1. Creates a temporary branch | ||
2. Applies the migration SQL in that branch | ||
3. Returns migration details for verification | ||
</workflow> | ||
<important_notes> | ||
After executing this tool, you MUST: | ||
1. Test the migration in the temporary branch using the 'run_sql' tool | ||
2. Ask for confirmation before proceeding | ||
3. Use 'complete_database_migration' tool to apply changes to main branch | ||
</important_notes> | ||
<example> | ||
For a migration like: | ||
ALTER TABLE users ADD COLUMN last_login TIMESTAMP; | ||
You should test it with: | ||
SELECT column_name, data_type | ||
FROM information_schema.columns | ||
WHERE table_name = 'users' AND column_name = 'last_login'; | ||
You can use 'run_sql' to test the migration in the temporary branch that this | ||
tool creates. | ||
</example> | ||
<return_data> | ||
Migration Details: | ||
- Migration ID (required for commit) | ||
- Temporary Branch Name | ||
- Temporary Branch ID | ||
- Migration Result | ||
</return_data> | ||
<next_steps> | ||
After executing this tool, you MUST follow these steps: | ||
1. Use 'run_sql' to verify changes on temporary branch | ||
2. Ask client: "Would you like to commit migration [migration_id] to main branch?" | ||
3. If approved, use 'complete_database_migration' tool with the migration_id | ||
</next_steps> | ||
`, | ||
@@ -218,4 +269,4 @@ inputSchema: { | ||
{ | ||
name: 'commit_database_migration', | ||
description: 'Commit a database migration when the user confirms the migration is ready to be applied to the main branch and notices the user that the temporary branch was deleted', | ||
name: 'complete_database_migration', | ||
description: 'Complete a database migration when the user confirms the migration is ready to be applied to the main branch. This tool also lets the client know that the temporary branch created by the prepare_database_migration tool has been deleted.', | ||
inputSchema: { | ||
@@ -270,5 +321,5 @@ type: 'object', | ||
]; | ||
async function handleListProjects() { | ||
async function handleListProjects(params) { | ||
log('Executing list_projects'); | ||
const response = await neonClient.listProjects({}); | ||
const response = await neonClient.listProjects(params); | ||
if (response.status !== 200) { | ||
@@ -457,2 +508,3 @@ throw new Error(`Failed to list projects: ${response.statusText}`); | ||
export const NEON_HANDLERS = { | ||
// for debugging reasons. | ||
__node_version: async (request) => ({ | ||
@@ -462,3 +514,9 @@ content: [{ type: 'text', text: process.version }], | ||
list_projects: async (request) => { | ||
const projects = await handleListProjects(); | ||
const { cursor, limit, search, orgId } = request.params.arguments; | ||
const projects = await handleListProjects({ | ||
cursor, | ||
limit, | ||
search, | ||
org_id: orgId, | ||
}); | ||
return { | ||
@@ -595,3 +653,3 @@ content: [{ type: 'text', text: JSON.stringify(projects, null, 2) }], | ||
}, | ||
start_database_migration: async (request) => { | ||
prepare_database_migration: async (request) => { | ||
const { migrationSql, databaseName, projectId } = request.params | ||
@@ -609,8 +667,19 @@ .arguments; | ||
text: ` | ||
Migration Details: | ||
- Migration ID: ${result.migrationId} | ||
- Temporary Branch Name: ${result.branch.name} | ||
- Temporary Branch ID: ${result.branch.id} | ||
- Migration Result: ${JSON.stringify(result.migrationResult, null, 2)} | ||
`, | ||
<status>Migration created successfully in temporary branch</status> | ||
<details> | ||
<migration_id>${result.migrationId}</migration_id> | ||
<temporary_branch> | ||
<name>${result.branch.name}</name> | ||
<id>${result.branch.id}</id> | ||
</temporary_branch> | ||
</details> | ||
<execution_result>${JSON.stringify(result.migrationResult, null, 2)}</execution_result> | ||
<next_actions> | ||
You MUST follow these steps: | ||
1. Test this migration using 'run_sql' tool on branch '${result.branch.name}' | ||
2. Verify the changes meet your requirements | ||
3. If satisfied, use 'complete_database_migration' with migration_id: ${result.migrationId} | ||
</next_actions> | ||
`, | ||
}, | ||
@@ -620,3 +689,3 @@ ], | ||
}, | ||
commit_database_migration: async (request) => { | ||
complete_database_migration: async (request) => { | ||
const { migrationId } = request.params.arguments; | ||
@@ -623,0 +692,0 @@ const result = await handleCommitMigration({ migrationId }); |
{ | ||
"name": "@neondatabase/mcp-server-neon", | ||
"version": "0.1.6", | ||
"version": "0.1.7-beta.1", | ||
"description": "MCP server for interacting with Neon Management API and databases", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# Neon MCP Server | ||
[![smithery badge](https://smithery.ai/badge/neon)](https://smithery.ai/protocol/neon) | ||
Model Context Protocol (MCP) is a [new, standardized protocol](https://modelcontextprotocol.io/introduction) for managing context between large language models (LLMs) and external systems. In this repository, we provide an installer as well as an MCP Server for [Neon](https://neon.tech). | ||
@@ -13,2 +15,10 @@ | ||
### Installing via Smithery | ||
To install Neon MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/protocol/neon): | ||
```bash | ||
npx -y @smithery/cli install neon --client claude | ||
``` | ||
## Requirements | ||
@@ -55,10 +65,8 @@ | ||
In the current project folder, run: | ||
The easiest way to iterate on the MCP Server is using the `mcp-client/`. Learn more in `mcp-client/README.md`. | ||
```bash | ||
npm install | ||
npm run watch | ||
node dist/index.js init $NEON_API_KEY | ||
``` | ||
Then, **restart Claude** each time you want to test changes. | ||
npm run watch # You can keep this open. | ||
cd mcp-client/ && NEON_API_KEY=... npm run start:mcp-server-neon | ||
``` |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
45823
10
1160
70
2
1