Skip to main content
Glama
cursor.txt4.52 kB
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context and tools to LLMs. Think of MCP as a plugin system for Cursor - it allows you to extend the Agent’s capabilities by connecting it to various data sources and tools through standardized interfaces. Learn More About MCP Visit the official MCP documentation to understand the protocol in depth ​ Uses MCP allows you to connect Cursor to external systems and data sources. This means you can integrate Cursor with your existing tools and infrastructure, instead of having to tell Cursor what the structure of your project is outside of the code itself. MCP servers can be written in any language that can print to stdout or serve an HTTP endpoint. This flexibility allows you to implement MCP servers using your preferred programming language and technology stack very quickly. ​ Examples Databases Allow Cursor to query your databases directly, instead of manually feeding in schemas, or manipulating the data yourself. Notion Read data out of notion to guide cursor to implement a feature GitHub Let Cursor create PRs, create branches, find code, etc Memory Allow Cursor to remember and recall information while you work Stripe Allow Cursor to create customers, manage subscriptions, etc ​ Architecture MCP servers are lightweight programs that expose specific capabilities through the standardized protocol. They act as intermediaries between Cursor and external tools or data sources. Cursor supports two transport types for MCP servers: 💻 stdio Transport - Runs on your local machine - Managed automatically by Cursor - Communicates directly via stdout - Only accessible by you locally Input: Valid shell command that is ran by Cursor automatically 🌐 SSE Transport - Can run locally or remotely - Managed and run by you - Communicates over the network - Can be shared across machines Input: URL to the /sse endpoint of an MCP server external to Cursor For stdio servers, the command should be a valid shell command that Cursor can run. For SSE servers, the URL should be the URL of the SSE endpoint, e.g. http://example.com:8000/sse. Each transport type has different use cases, with stdio being simpler for local development and SSE offering more flexibility for distributed teams. ​ Configuring MCP Servers The MCP configuration file uses a JSON format with the following structure: CLI Server - Node.js CLI Server - Python SSE Server Copy // This example demonstrated an MCP server using the stdio format // Cursor automatically runs this process for you // This uses a Python server, ran with `python` { "mcpServers": { "server-name": { "command": "python", "args": ["mcp-server.py"], "env": { "API_KEY": "value" } } } } The env field allows you to specify environment variables that will be available to your MCP server process. This is particularly useful for managing API keys and other sensitive configuration. ​ Configuration Locations You can place this configuration in two locations, depending on your use case: Project Configuration For tools specific to a project, create a .cursor/mcp.json file in your project directory. This allows you to define MCP servers that are only available within that specific project. Global Configuration For tools that you want to use across all projects, create a \~/.cursor/mcp.json file in your home directory. This makes MCP servers available in all your Cursor workspaces. ​ Using MCP Tools in Agent The Composer Agent will automatically use any MCP tools that are listed under Available Tools on the MCP settings page if it determines them to be relevant. To prompt tool usage intentionally, simply tell the agent to use the tool, referring to it either by name or by description. ​ Tool Approval By default, when Agent wants to use an MCP tool, it will display a message asking for your approval. You can use the arrow next to the tool name to expand the message, and see what arguments the Agent is calling the tool with. ​ Yolo Mode You can enable Yolo mode to allow Agent to automatically run MCP tools without requiring approval, similar to how terminal commands are executed. Read more about Yolo mode and how to enable it here. ​ Tool Response When a tool is used Cursor will display the response in the chat. This image shows the response from the sample tool, as well as expanded views of the tool call arguments and the tool call response. ​

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/quintonwall/fast-pyairbyte'

If you have feedback or need assistance with the MCP directory API, please join our Discord server