Cursor IDE Integration
STDIOMultiple MCP servers designed to work with Cursor IDE through standardized communication protocol.
Multiple MCP servers designed to work with Cursor IDE through standardized communication protocol.
This project hosts multiple Model-Context-Protocol (MCP) servers designed to work with the Cursor IDE. MCP servers allow Cursor to leverage external tools and functionalities through a standardized communication protocol.
Clone this repository:
git clone https://github.com/yourusername/mcp-servers.git
cd mcp-servers
Install dependencies and set up everything:
npm run setup
This command will:
Configure Cursor IDE:
Environment Variables:
.env.example
file to .env
Use Mcp In Cursor IDE:
Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs (Large Language Models). Think of MCP like a communication interface between Cursor IDE and external tools. MCP servers expose tools that can be used by Cursor IDE to enhance its capabilities.
mcp-servers/
├── src/
│ ├── servers/ # Individual MCP servers
│ │ ├── addition-server/ # Example addition server
│ │ │ └── addition-server.ts
│ │ └── ... (more servers)
│ ├── template/ # Reusable templates
│ │ └── mcp-server-template.ts
│ ├── index.ts # Server runner utility
│ └── run-all.ts # Script to run all servers
├── package.json
└── tsconfig.json
Currently, the following MCP servers are available:
The Jira server requires the following environment variables:
Create a .env
file in the project root (or copy from .env.example
):
# Jira API Configuration
JIRA_API_URL=https://your-domain.atlassian.net
[email protected]
JIRA_API_TOKEN=your-jira-api-token
Generate an API token at: https://id.atlassian.com/manage-profile/security/api-tokens
The Jira server exposes the following tools:
get_projects
- Retrieves all accessible Jira projectsget_project
- Gets details about a specific project by keysearch_issues
- Searches for issues using JQL (Jira Query Language)get_issue
- Gets details about a specific issue by keyget_boards
- Retrieves all accessible boardsget_sprints
- Gets all sprints for a specific boardThe GitHub server requires the following environment variables:
Create a .env
file in the project root (or copy from .env.example
):
# GitHub API Configuration
GITHUB_TOKEN=your-github-personal-access-token
Generate a personal access token at: https://github.com/settings/tokens
The GitHub server exposes the following tools:
get_repositories
- Retrieves all repositories accessible to the authenticated userget_repository
- Gets details about a specific repositoryget_issues
- Retrieves issues for a repositoryget_issue
- Gets details about a specific issueget_pull_requests
- Retrieves pull requests for a repositoryget_pull_request
- Gets details about a specific pull requestget_branches
- Retrieves branches for a repositoryget_commits
- Gets commits for a repository, optionally filtered by branchcomment_on_pr
- Adds a comment to a specific pull request (always signed with "Created by Cursor")summarize_pr_diff
- Generates a summary of PR changes and optionally posts it as a commentThe PostgreSQL server requires the following environment variables:
Create a .env
file in the project root (or copy from .env.example
):
# PostgreSQL Configuration
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=your_database_name
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password
# POSTGRES_SSL_MODE=require # Uncomment if SSL is required
# POSTGRES_MAX_CONNECTIONS=10 # Optional: limit connection pool size
Ensure you have a PostgreSQL database running and accessible with the provided credentials.
The PostgreSQL server exposes the following tools:
mcp__get_database_info
- Retrieves information about the connected databasemcp__list_tables
- Lists all tables in the current database schemamcp__get_table_structure
- Gets the column definitions for a specific tablemcp__execute_query
- Executes a custom SQL query against the databaseThe Kubernetes server requires the following environment variables:
Create a .env
file in the project root (or copy from .env.example
):
# Kubernetes Configuration
KUBECONFIG=/path/to/your/kubeconfig
# or
# KUBE_API_URL=https://your-kubernetes-api-server
# KUBE_API_TOKEN=your-kubernetes-service-account-token
Ensure you have access to a Kubernetes cluster and the appropriate permissions.
The Kubernetes server exposes the following tools:
get_pods
- Retrieves pods from a specified namespace, with optional field and label selectorsfind_pods
- Finds pods matching a name pattern in a specified namespacekill_pod
- Deletes a pod in a specified namespaceexec_in_pod
- Executes a command in a specified pod and containerget_pod_logs
- Retrieves logs from a specified pod, with options for container, line count, and previous instanceThe setup command creates individual shell scripts for each server that can be used directly with Cursor IDE.
After running npm run setup
, you'll see instructions for each server configuration.
To run a specific server using the included helper script:
npm run server -- [server-name]
For example, to run the addition server:
npm run server -- addition
This will automatically build the TypeScript code and start the server.
To run a specific server manually:
npm run dev -- [server-name]
For example, to run the addition server:
npm run dev -- addition
To run all servers simultaneously:
npm run dev:all
To see a list of all available servers:
npm run dev -- --list
Before connecting to Cursor IDE, you can test your MCP server's functionality:
Build your TypeScript project:
npm run build
Run the server:
npm run start:addition
In a separate terminal, you can test the server by sending MCP protocol messages manually:
{ "type": "request", "id": "test1", "name": "add", "params": { "num1": 5, "num2": 7 } }
The server should respond with:
{ "type": "response", "id": "test1", "content": [ { "type": "text", "text": "The sum of 5 and 7 is 12." }, { "type": "text", "text": "{\n \"num1\": 5,\n \"num2\": 7,\n \"sum\": 12\n}" } ] }
For convenience, this project includes a ready-to-use script for Cursor:
/path/to/mcp-servers/cursor-mcp-server.sh
You can use this script path directly in your Cursor IDE configuration.
To add a new MCP server to this project:
Create a new directory for your server under src/servers/
:
mkdir -p src/servers/my-new-server
Create your server implementation:
// src/servers/my-new-server/my-new-server.ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; // Create an MCP server const server = new McpServer({ name: "My New Server", version: "1.0.0", }); // Add your tools server.tool( "my-tool", { param1: z.string().describe("Parameter description"), param2: z.number().describe("Parameter description"), }, async ({ param1, param2 }) => { // Tool implementation return { content: [{ type: "text", text: `Result: ${param1} ${param2}` }], }; } ); // Start the server async function startServer() { const transport = new StdioServerTransport(); await server.connect(transport); console.log("My New Server started and ready to process requests"); } // Start the server if this file is run directly if (process.argv[1] === new URL(import.meta.url).pathname) { startServer(); } export default server;
Add your server to the server list in src/index.ts
and src/run-all.ts
:
const servers = [ // ... existing servers { name: "my-new-server", displayName: "My New Server", path: join(__dirname, "servers/my-new-server/my-new-server.ts"), }, ];
Update the package.json scripts (optional):
"scripts": { // ... existing scripts "dev:my-new-server": "ts-node --esm src/servers/my-new-server/my-new-server.ts" }
When developing an MCP server, keep in mind:
Tools are the primary way to expose functionality. Each tool should:
Communication happens via stdio for Cursor integration.
Response Format is critical - MCP servers must follow the exact format:
type: "text"
for text responsestype: "json"
directlytype: "text"
return { content: [ { type: "text", text: "Human-readable response" }, { type: "text", text: JSON.stringify(structuredData, null, 2) }, ], };
To build the project, run:
npm run build