Skip to content

devitwise/mcp-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MCP Template — build MCP servers with Cursor AI

What is this?

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:

  • Dockerfile
  • requirements.txt
  • src/[NAME]_server.py (FastMCP server with tools)
  • README.md and CLAUDE.md for the generated project

The server runs in Docker with input validation, logging, and error handling.


How to use it

1. Clone and open in Cursor

git clone <url-this-repo> mcp-template
cd mcp-template
cursor .

2. Use the agent to build an MCP server

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 integration
  • Build an MCP server with nmap, nikto, and sqlmap tools
  • Create an MCP server with a weather API
  • I need an MCP server for Jira with OAuth
  • Create 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).

3. Build the Docker image and run the server

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.)

4. Connect the MCP server to Cursor AI

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).


Example: adding an MCP server in Cursor AI (example-mcp.json)

After building your MCP server (e.g. image my-mcp-server), add it in Cursor:

  1. Open MCP settings in Cursor (Settings → MCP or edit the MCP config file).
  2. 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.


Summary

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors