The MCP server implements the Model Context Protocol standard, providing a unified gateway for various tools including GitHub, GitLab, Google Maps, Memory storage, and Puppeteer web automation. It offers a modular architecture where each tool is a separate module, simplifying routing and management of multiple service integrations.
Clone the repository:
git clone https://github.com/yourusername/mcp-server.git
cd mcp-server
Install Python dependencies:
pip install -r requirements.txt
Install Node.js dependencies:
npm install
Create a .env
file with your configuration:
SECRET_KEY=your-secret-key
DEBUG=False
# GitHub configuration
GITHUB_TOKEN=your-github-token
# GitLab configuration
GITLAB_TOKEN=your-gitlab-token
# Google Maps configuration
GMAPS_API_KEY=your-google-maps-api-key
# Memory configuration
MEMORY_DB_URI=sqlite:///memory.db
# Puppeteer configuration
PUPPETEER_HEADLESS=true
CHROME_PATH=/usr/bin/chromium-browser
Start the server:
python app.py
Build the Docker image:
docker build -t mcp-server .
Run the container:
docker run -p 5000:5000 --env-file .env mcp-server
Alternatively, use docker-compose:
Create a docker-compose.yml
file:
version: '3'
services:
mcp-server:
build: .
ports:
- "5000:5000"
volumes:
- ./data:/app/data
env_file:
- .env
restart: unless-stopped
Then run:
docker-compose up -d
For Red Hat based systems:
Build the container image:
podman build -t mcp-server .
Run the container:
podman run -p 5000:5000 --env-file .env mcp-server
For persistent storage:
mkdir -p ./data
podman run -p 5000:5000 --env-file .env -v ./data:/app/data:Z mcp-server
Using Podman Compose:
# Install podman-compose if needed
pip install podman-compose
# Use the same docker-compose.yml file
podman-compose up -d
The main endpoint for accessing all tools using the MCP standard.
Endpoint: POST /mcp/gateway
Request format:
{
"tool": "github",
"action": "listRepos",
"parameters": {
"username": "octocat"
}
}
Response format:
{
"tool": "github",
"action": "listRepos",
"status": "success",
"result": [
{
"id": 1296269,
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1
}
}
]
}
Describes all available tools and their capabilities.
Endpoint: GET /mcp/manifest
Response format:
{
"manifestVersion": "1.0",
"tools": {
"github": {
"actions": {
"listRepos": {
"description": "List repositories for a user or organization",
"parameters": {
"username": {
"type": "string",
"description": "GitHub username or organization name"
}
},
"returns": {
"type": "array",
"description": "List of repository objects"
}
}
}
}
}
}
Each tool can be accessed directly via its own API endpoints:
/tool/github/...
/tool/gitlab/...
/tool/gmaps/...
/tool/memory/...
/tool/puppeteer/...
Provides access to the GitHub API.
Actions:
listRepos
: List repositories for a user or organizationgetRepo
: Get details for a specific repositorysearchRepos
: Search for repositoriesgetIssues
: Get issues for a repositorycreateIssue
: Create a new issue in a repositoryProvides access to the GitLab API.
Actions:
listProjects
: List all accessible projectsgetProject
: Get details for a specific projectsearchProjects
: Search for projectsgetIssues
: Get issues for a projectcreateIssue
: Create a new issuegetPipelines
: Get pipelines for a projectProvides access to the Google Maps API.
Actions:
geocode
: Convert an address to coordinatesreverseGeocode
: Convert coordinates to an addressgetDirections
: Get directions between locationssearchPlaces
: Search for placesgetPlaceDetails
: Get details for a specific placeProvides a persistent key-value store.
Actions:
get
: Get a memory item by keyset
: Create or update a memory itemdelete
: Delete a memory item by keylist
: List all memory itemssearch
: Search memory items by valueProvides web automation capabilities.
Actions:
screenshot
: Take a screenshot of a webpagepdf
: Generate a PDF of a webpageextract
: Extract content from a webpageThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.