This repository is a template / example for configuring Cursor AI to build MCP servers (Model Context Protocol). It does not include a ready-made MCP server — it includes an agent (mcp-server-builder) that, inside Cursor AI, generates a complete MCP server from your requirements.
After cloning this repo and opening it in Cursor you can ask the agent to create an MCP server (e.g. for GitHub API, security tools, weather, Jira, etc.). The agent will generate:
Dockerfilerequirements.txtsrc/[NAME]_server.py(FastMCP server with tools)README.mdandCLAUDE.mdfor the generated project
The server runs in Docker with input validation, logging, and error handling.
git clone <url-this-repo> mcp-template
cd mcp-template
cursor .In Cursor, start a chat with AI and invoke the agent mcp-server-builder, describing the server you want:
Example prompts:
Use mcp-server-builder: create an MCP server for GitHub API integrationBuild an MCP server with nmap, nikto, and sqlmap toolsCreate an MCP server with a weather APII need an MCP server for Jira with OAuthCreate security testing MCP tools for pentesting
The agent may ask follow-up questions (API, tools, auth), then will generate 5 files in the project structure (including src/ for the server script).
In the generated project directory (or wherever you saved the files):
docker build -t my-mcp-server .
docker run --rm -i my-mcp-server(MCP server talks over stdio, so -i is required.)
To use your MCP server from Cursor, add it in MCP settings.
Where MCP config lives in Cursor
- Cursor Settings → MCP (or the MCP config file used by your Cursor setup).
Example config — how to add a Docker-run server — is in example-mcp.json in this repo. Copy the relevant entry into your MCP config (e.g. the mcp.json used by Cursor).
After building your MCP server (e.g. image my-mcp-server), add it in Cursor:
- Open MCP settings in Cursor (Settings → MCP or edit the MCP config file).
- Under
mcpServers, add an entry for your server.
Example for a server run via Docker (no env vars):
{
"mcpServers": {
"my-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"my-mcp-server"
]
}
}
}If the server needs env vars (e.g. API key):
{
"mcpServers": {
"my-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"API_KEY",
"my-mcp-server"
],
"env": {
"API_KEY": "<your-api-key>"
}
}
}
}A full example config file is in example-mcp.json in the repo root — copy it and change the server name and Docker image name as needed.
| Step | Action |
|---|---|
| 1 | Clone this repo and open it in Cursor. |
| 2 | In a Cursor AI chat, invoke the mcp-server-builder agent and describe the MCP server (e.g. API, tools). |
| 3 | Save the generated files (Dockerfile, src/*_server.py, requirements.txt, etc.) in one project. |
| 4 | Build the image: docker build -t IMAGE_NAME . |
| 5 | Add the server in Cursor MCP settings (see example-mcp.json). |
| 6 | Restart Cursor / reload MCP and use the server’s tools in chat. |
This repository is an example / template — it is for building an MCP server with Cursor AI, not a ready-to-run server by itself.