原始内容
MCP Servers for Cursor AI
This repository contains Model Context Protocol (MCP) server setups for Cursor AI, enabling integration with external tools and databases.
Available MCP Servers
1. PostgreSQL MCP Server
A full-featured Model Context Protocol (MCP) server that provides PostgreSQL database management capabilities. This server assists with analyzing existing PostgreSQL setups, providing implementation guidance, debugging database issues, managing schemas, migrating data, and monitoring database performance.
- Location:
./postgresql-mcp/ - Features: Database analysis, schema management, data migration, monitoring
- Source: HenkDz/postgresql-mcp-server
Main Tools
analyze_database: Analyze PostgreSQL configuration and performanceget_setup_instructions: Get step-by-step PostgreSQL setup guidancedebug_database: Debug common PostgreSQL issuesget_schema_info: Retrieve database schema informationcreate_table,alter_table: Manage database tablesexport_table_data,import_table_data: Migrate data between formatscopy_between_databases: Copy data between PostgreSQL instancesmonitor_database: Real-time monitoring of PostgreSQL metrics
Usage Examples in Cursor AI
- "Analyze my PostgreSQL database at postgresql://user:password@localhost:5432/dbname"
- "Show me the schema for the users table in my PostgreSQL database"
- "Create a new products table with id, name, price, and created_at columns"
- "Monitor my database performance and show me any queries taking longer than 30 seconds"
2. Obsidian MCP Server
A server that enables AI interaction with Obsidian.md notes and vaults through the Local REST API plugin. This allows you to search, read, and write content in your Obsidian vault directly from Cursor AI.
- Location:
./obsidian-mcp/ - Features: List files, search notes, read and write content
- Source: MarkusPfundstein/mcp-obsidian
- Requires: Obsidian with the Local REST API plugin installed
Main Tools
list_files_in_vault: List all files in your Obsidian vaultlist_files_in_dir: List files in a specific directoryget_file_contents: Get the content of a specific notesimple_search: Search your vault for text matchescomplex_search: Advanced search with pattern matchingpatch_content: Insert content into existing notesappend_content: Add content to new or existing notesbatch_get_file_contents: Retrieve multiple files at once
Usage Examples in Cursor AI
- "List all files in my Obsidian vault"
- "Get the content of my note called 'Project Requirements'"
- "Search my vault for all mentions of 'machine learning'"
- "Create a new note called 'Meeting Summary' with a summary of the latest project meeting"
- "Add today's tasks to my 'Daily Notes' file under the heading 'Tasks'"
3. n8n MCP Server
A server that provides integration with n8n instances via the n8n API, enabling workflow management and execution directly from Cursor AI. Built with the MCP SDK for standardized communication.
- Location:
./n8n-mcp/ - Features: List workflows, manage workflow state, execute workflows, view executions
- Requires: n8n instance with API access
- Implementation: Uses the Model Context Protocol SDK with Zod validation
Main Tools
mcp_list_workflows: List all workflows in the n8n instancemcp_get_workflow: Get details of a specific workflow by IDmcp_activate_workflow: Activate a specific workflow by IDmcp_deactivate_workflow: Deactivate a specific workflow by IDmcp_execute_workflow: Execute a specific workflow with optional input datamcp_list_workflow_executions: List executions for a specific workflowmcp_get_execution: Get details of a specific execution by ID
Usage Examples in Cursor AI
- "List all workflows in my n8n instance"
- "Show me the details of workflow X"
- "Activate workflow Y so it starts listening for triggers"
- "Execute workflow Z with this input data"
- "Show me all recent executions of workflow X"
- "Get the execution details for run ABC"
4. Gemini Image MCP Server
A server that provides AI image generation capabilities using Google's Gemini 2.5 Flash Image model. Generate high-quality images directly from text descriptions with full control over size, output location, and generation parameters.
- Location:
./gemini-image-mcp/ - Features: Text-to-image generation, multiple sizes, customizable output, streaming support
- Requires: Google Gemini API key
- Implementation: Built with MCP SDK, fully configurable parameters
Main Tools
generate_image: Generate images from text prompts with customizable parameters- Supports multiple image sizes (256px, 512px, 1K, 2K, 4K)
- Configurable output directory and file naming
- Optional AI text descriptions of generated images
- Automatic file management and validation
Usage Examples in Cursor AI
- "Generate an image of a sunset over the ocean"
- "Generate a 4K image of a futuristic city with flying cars"
- "Generate an image of a cute robot, save it to ./my-images/"
- "Generate a 2K image of a fantasy castle on a floating island, name it castle_concept.png"
- "Generate an image of a modern minimalist coffee maker, product photography style"
Configuration
All settings are highly configurable in src/config.ts:
- Image sizes and default size
- Output directory and file naming patterns
- Model selection and response modalities
- Request timeouts and concurrency limits
- Validation rules and security settings
- Logging and debug options
Setup Instructions
Prerequisites
- Node.js 18 or higher
- Python 3.11 or higher with pip
- Obsidian.md with Local REST API plugin installed (for Obsidian integration)
- PostgreSQL database (for PostgreSQL integration)
- n8n instance with API access (for n8n integration)
- Google Gemini API key (for Gemini Image integration)
PostgreSQL Server Setup
Navigate to the PostgreSQL MCP directory:
cd postgresql-mcpInstall dependencies and build:
npm install npm run buildThe server will be built to
build/index.js
Obsidian Server Setup
Install the Local REST API plugin in Obsidian:
- Open Obsidian settings → Community plugins
- Browse for "Local REST API" and install
- Enable the plugin and copy the API key from settings
Navigate to the Obsidian MCP directory:
cd obsidian-mcpInstall the package in development mode:
pip install -e .Set your API key in
.envfile or in the MCP configuration
n8n Server Setup
Set up an n8n instance and create an API key:
- Log in to your n8n instance
- Go to Settings → API
- Create a new API key with appropriate permissions
- Copy the API key
Navigate to the n8n MCP directory:
cd n8n-mcpInstall dependencies and build:
npm install npm run buildSet your n8n URL and API key in
.envfile or in the MCP configuration
Gemini Image Server Setup
Get a Google Gemini API key:
- Visit Google AI Studio
- Create or sign in to your Google account
- Generate an API key
Navigate to the Gemini Image MCP directory:
cd gemini-image-mcpInstall dependencies and build:
npm install npm run buildThe server will be built to
build/index.js(Optional) Customize configuration:
- Edit
src/config.tsto adjust image sizes, output paths, or other settings - Run
npm run buildagain after making changes
- Edit
Configuration for Cursor AI
Edit your Cursor AI MCP configuration file at ~/.cursor/mcp.json:
{
"mcpServers": {
"postgresql-mcp": {
"command": "node",
"args": ["/path/to/mcp-servers/postgresql-mcp/build/index.js"],
"env": {
"PG_DB_MAP": "{\"db1\":\"postgresql://username:password@hostname:5432/database_name?sslmode=require\",\"analytics\":\"postgresql://analytics_user:secure_password@analytics-db.example.com:5432/analytics?sslmode=require\",\"default\":\"db1\"}"
}
},
"mcp-obsidian": {
"command": "/path/to/python/bin/mcp-obsidian",
"args": [],
"env": {
"OBSIDIAN_API_KEY": "your_api_key_here"
}
},
"n8n-mcp": {
"command": "node",
"args": ["/path/to/mcp-servers/n8n-mcp/build/index.js"],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.example.com",
"N8N_API_KEY": "your_api_key_here"
}
},
"gemini-image-mcp": {
"command": "node",
"args": ["/path/to/mcp-servers/gemini-image-mcp/build/index.js"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here"
}
}
}
}
Replace paths, connection details, and API keys with your actual values.
Debugging
Log Files
- PostgreSQL MCP logs:
~/Library/Logs/Cursor/mcp-server-postgresql-mcp.log - Obsidian MCP logs:
~/Library/Logs/Cursor/mcp-server-mcp-obsidian.log - n8n MCP logs:
~/Library/Logs/Cursor/mcp-server-n8n-mcp.log - Gemini Image MCP logs:
~/Library/Logs/Cursor/mcp-server-gemini-image-mcp.log
Using MCP Inspector
For PostgreSQL:
npx @modelcontextprotocol/inspector node /path/to/postgresql-mcp/build/index.js
For Obsidian:
npx @modelcontextprotocol/inspector /path/to/python/bin/mcp-obsidian
For n8n:
npx @modelcontextprotocol/inspector node /path/to/n8n-mcp/build/index.js
For Gemini Image:
npx @modelcontextprotocol/inspector node /path/to/gemini-image-mcp/build/index.js
Make sure to set the GEMINI_API_KEY environment variable before running the inspector.
Security Considerations
- PostgreSQL connection strings contain sensitive credentials - use environment variables when possible
- The Obsidian MCP server has read/write access to your notes - review permissions carefully
- The n8n API key provides access to your workflows - use an API key with appropriate permissions
- The Gemini API key provides access to Google's image generation service - never commit it to version control
- The Gemini server validates output paths to prevent directory traversal attacks
- All servers run locally on your machine and don't expose services to the network by default