If you're building with models in Cursor and keep re-writing glue code for APIs, file systems, or dev tools, the Model Context Protocol (MCP) will make your life easier. MCP gives Cursor's Composer a standard way to discover resources, call tools, and reuse prompts exposed by an external process called an MCP server.
This post shows how to add an MCP server to Cursor, verify it works, and troubleshoot common issues—without buzzwords.
stdio
(local process) or SSE
(HTTP streaming).Cursor connects to the server, lists capabilities, and invokes tools with your approval.
stdio (TypeScript weather server)
node ~/mcp-quickstart/weather-server-typescript/build/index.js
SSE (demo)
http://example.com:8000/sse
Tip: On macOS/Linux, make your server script executable so you can run it by name.
Once the server is added:
Try prompts like:
If you see an approval dialog and a response payload, you’re connected.
Some servers need API keys or config. A simple wrapper script keeps your command clean:
#!/usr/bin/env bash
# file: start-weather.sh
export WEATHER_API_KEY="sk-..."
exec node ~/mcp-quickstart/weather-server-typescript/build/index.js
Then set the Command in Cursor to:
~/mcp-quickstart/start-weather.sh
You can also inline env vars:
WEATHER_API_KEY=sk-... node ~/mcp-quickstart/weather-server-typescript/build/index.js
| Symptom | Likely cause | Fix |
|---|---|---|
| Tools don’t show up | Server not running; stale list | Start the server; click Refresh; check logs/console |
| “Model can’t call tools” | Current model lacks tool-use | Switch to a model that supports tool calling in Composer |
| “Command not found” | Wrong path/permissions | Use an absolute path; chmod +x
wrapper; verify Node version |
| SSE won’t connect | Wrong URL/CORS/TLS | Verify URL, scheme (https://
if needed), and server SSE headers |
| Tool runs but returns errors | Input mismatch/validation | Inspect arguments in approval dialog; align schema & prompt |
| Tools slow or time out | Network/DB slowness | Add timeouts and retries; paginate/stream large responses |
Open Settings → Features → MCP, select the server, and remove or toggle it off. Keep wrapper scripts and keys out of your repo if they’re local-only.
MCP turns scattered integrations into one clean interface. In Cursor, that means faster setup, safer tool calls, and reusable servers you can share across projects. Add a server, run a smoke test, and start replacing glue code with something you won’t have to rewrite next time.
Expert developer passionate about modern web technologies and AI-assisted development.
Get the latest articles and tutorials delivered to your inbox.