MCP in production
Add MCP Servers to Cursor: Setup and Debugging (2026)
Configure MCP servers in Cursor with a documented starter config, scoped permissions, and checks for command, path, environment, transport, and logs.

Add MCP Servers to Cursor: Setup and Debugging (2026)
TL;DR — To add MCP servers to Cursor, put the provider's configuration in
~/.cursor/mcp.jsonor the project's.cursor/mcp.json, authenticate, and inspect its tools. If connection fails, read the logs and check the command, paths, environment, and transport. A red indicator is a symptom, not a diagnosis. Sadly, it cannot do the debugging for us.
We recommend connecting one server before assembling a fleet. For provider-specific options, start with 14 MCP server examples with setup notes. An MCP server exposes tools and context to the editor; agent orchestration coordinates several agents or tools. For the broader decision, read MCP Server vs REST API and MCP Server Architecture. The configuration below follows published documentation; it is not an authenticated test of your account.
Where do MCP servers go in Cursor?
Use the global file for tools across projects, or .cursor/mcp.json for one project. If you choose the global file, create it without overwriting existing entries:
mkdir -p ~/.cursor
touch ~/.cursor/mcp.json
A hosted example using AppHandoff's documented endpoint and OAuth flow:
{
"mcpServers": {
"AppHandoff": {
"url": "https://api.apphandoff.com/mcp"
}
}
}
Choose the transport the provider supports:
- Streamable HTTP (
url) — a hosted connection, with the provider's authentication flow. - stdio (
command+args) — a local process, useful for filesystem or development tools. - SSE — also supported by Cursor; use it only when the provider documents that endpoint.
Cursor supports ${env:VAR_NAME} interpolation. Keep credential values out of shared configuration. The official Cursor MCP guide documents file locations, supported transports, and configuration fields.
Connect one server before adding more
- Choose a task. Start with a read request against a project you are allowed to access. Decide what a correct answer would look like before asking the agent.
- Add its documented configuration. Merge the entry into the existing
mcpServersobject. Keep account credentials out of version control. - Authenticate with the provider. For the AppHandoff example, complete OAuth and check the selected account and project. No pasted bearer token is needed in this example.
- Inspect the available tools. Check that the tool you need is present and enabled. A connected server may expose writes as well as reads.
- Run one narrow read. Ask for a specific ticket or record and compare the answer with its source. A confident paragraph is not a connection receipt.
For other providers, use the individual setup links in 14 MCP server examples. Adding an entire collection at once makes it harder to isolate which connection failed.
stdio vs HTTP: picking the right transport
We recommend stdio when the tool needs a local project directory or subprocess. Consider a hosted connection when teammates need access to the same remote service. Neither choice settles authorization: review the tool's permitted operations independently of its transport.
For a local process, reproduce its launch independently. For a hosted service, investigate its endpoint and authentication. We choose transport around where the tool needs to run, not which acronym looks more enterprise-ready.
MCP vs traditional Cursor rules / snippets
Instructions and live tool access solve different problems. Why add MCP alongside your project conventions?
- Project instructions describe how the agent should work.
- MCP tools are dynamic. The agent calls them when it decides the current task needs that data.
Rules = "here's how we write code." MCP = "go look at what the current production database actually contains right now." You want both.
If you're still relying on copy/paste of schema + docs into chat, you're doing the job MCP was built to eliminate.
How do you diagnose a red MCP connection?
Open Cursor's Output panel and select MCP Logs, as its debugging instructions describe. Record the first relevant error and the server name. We use the following decision tree; it is a troubleshooting recommendation, not a ranking of measured failure rates.
- No server entry or parse error? Check the file you edited, JSON syntax, and whether the server is enabled. Compare the entry with the provider's current example before changing credentials.
- Local process will not start? Check the exact
command, every argument, runtime installation, and executable path. Run that command independently with the intended working directory. If it starts there but fails in Cursor, compare the two launch environments instead of declaring the server healthy. - Missing file or variable? Use absolute paths for scripts and configuration files. Verify required environment-variable names are available to the launched process without printing their values. A successful shell export alone is not evidence that the editor's process received it.
- Remote connection rejected? Compare the URL and transport with the provider guide. Check account access, OAuth completion or token scope, and the reported HTTP status. Test initialization with an MCP-aware client such as the official MCP Inspector; a bare
tools/listHTTP request is not a complete session test. For a public remote server, you can also paste its URL into our online MCP inspector to list its tools, resources and prompts without installing anything; it is built for public server URLs, so use the official inspector for a local stdio server. - Process starts but initialization fails? Inspect the server logs for protocol errors or crashes. For stdio, send diagnostic output to stderr, keeping stdout for protocol traffic. The MCP debugging guide explains path, environment, and logging pitfalls.
- After correcting the identified cause, reconnect the server; restart Cursor if its process environment or local server code changed. Then repeat one narrow read and check the returned account, project, and record. Do not turn on automatic write approval to make an error disappear.
Keep the failing input, redacted error, and final successful request together. That gives the next person something better than “it went green eventually.”
Environment variables the right way
Use the provider's OAuth flow where available. When a server requires environment variables, follow its documented names and your team's secret-management process. Do not paste values into chat to prove they exist.
For local stdio servers, Cursor also documents envFile; remote HTTP/SSE entries do not support it. Keep any such file outside version control. If a key has leaked, rotate it at the provider and update the configured source before reconnecting. Deleting the visible string does not revoke the credential.
Three workflows that justify the setup
1. "What changed in this repository?" — Ask a repository tool for relevant merged pull requests, then draft a changelog with links to the changes. Review those links before publishing.
2. "What evidence explains this failure?" — Use authorized log and database tools to inspect a bounded time window and the relevant record. Treat the output as evidence for a hypothesis, not permission to change production.
3. "Build this page using our existing patterns." — Read the project's components and conventions before proposing edits. Review the diff and run the relevant checks; access to tools does not replace validation.
These are suggested workflows, not timed demonstrations. A repeated task is a better reason to maintain a connection than the urge to collect another server badge.
What does AppHandoff do here?
AppHandoff coordinates tickets and shared project context between agents. It is the product used in the configuration example above. Our AI agent platform service covers building and integrating agent systems; it is a separate service destination, not the AppHandoff product page.
For a custom server, define the allowed operations before adding a connection URL. See MCP Server Architecture for authentication, bounded responses, and failure handling. He decides what the system is allowed to do; we would prefer to learn that before the first write.
Working config checklist
- The chosen global or project
mcp.jsoncontains valid configuration - One required server is configured using its provider guide
- Required environment variables reach the local server process
- Secrets never inlined
- Authentication and project scope have been checked
- Connection errors have been resolved using logs
- One intended read returned the expected record
If the connection works but the task fails, keep investigating the specific tool, permissions, and arguments. Connection health and task correctness are different checks.
Want help building your own?
If your team has an internal system that should expose MCP tools, explore our AI agent platform service. Bring the intended workflow and a redacted error if one exists. We can work with evidence. “The dot is red” is a start, but not much of a specification.