procursorrules.com
RulesGenerateMCP ServersBlog
Sign In

Ready to enhance your cursor experience?

Join our community today and get access to exclusive cursor rules, resources, and connect with other cursor enthusiasts.

Get StartedLearn More
procursorrules.com

The home for Cursor enthusiasts where you can explore and generate rules, browse MCPs, post and follow the latest news, learn, connect, and discover jobs.

GitHubTwitter

Products

  • Cursor Rules
  • MCP Directory
  • Rule Generator

Resources

  • Cursor Documentation
  • Blog
  • Support

Frendlink

  • FluxKontext.biz
  • BG Remove Pro
  • Labubu Style Generator
  • LaunchVault
  • OG Generator
  • Just Simple Tools

Stay Updated

Subscribe to our newsletter to get the latest updates on cursor rules, tutorials, and community news.

By subscribing, you agree to our Terms and Privacy Policy.

  • Featured on findly.tools
  • Startup Benchmarks
  • Acid Tools
  • AIGC 160
  • AI Toolz
  • z-image.win
  • Launch Vault
  • Hunt for Tools
  • SaaS Field
  • SaaS Hub Directory
  • SaaS Roots
© 2026 Pro Cursor Rules. All rights reserved.
Terms of Service
Privacy Policy
About Us
Made withbySkyler Scofield
How to Use Model Context Protocol (MCP) in Cursor | Pro Cursor Rules
Back to blog
Blog / cursor-mcp

How to Use Model Context Protocol (MCP) in Cursor

How to Use Model Context Protocol (MCP) in Cursor
cursor-mcp
agents
Cursor
developer-tools
LLM tools
MCP
tutorial
C
Cursor Rules Pro Team
Expert Development Team
2025-09-02
4 min read

How to Use Model Context Protocol (MCP) in Cursor

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.


What you’ll need

  • Cursor with Composer enabled.
  • For stdio servers: Node.js (or the runtime your server needs).
  • For SSE servers: a reachable HTTP(S) endpoint.
  • Optional: any API keys your server requires.

MCP in 30 seconds

  • Client: Cursor’s Composer (the Agent).
  • Server: a separate process exposing capabilities.
  • Capabilities:
    • Resources — read surfaces (files, DB queries, docs).
    • Tools — actions you can run (search, write, transform, deploy).
    • Prompts — reusable, parameterized templates.
Share this article

Related Articles

What Is MCP? A Plain‑English Guide for Builders
mcp-guide

What Is MCP? A Plain‑English Guide for Builders

A no‑nonsense introduction to the Model Context Protocol: what it is, why it matters, and how to use it without drowning in glue code.

2025-09-025 min read
Getting Started with Cursor: A Practical Setup Guide
cursor-editor

Getting Started with Cursor: A Practical Setup Guide

Learn how to set up Cursor AI editor from scratch. A complete guide covering installation, configuration, extensions, and essential features to get you productive from day one.

2025-09-014 min read

Comments

YU
Markdown supported

Table of Contents

What you’ll needMCP in 30 secondsInstall & configure in CursorExample configurationsUsing the tools inside ComposerA quick smoke testEnvironment variables (wrapping stdio servers)Designing tools that work well in CursorTroubleshootingAdvanced tipsUninstall or disable
  • Transport: stdio (local process) or SSE (HTTP streaming).
  • Cursor connects to the server, lists capabilities, and invokes tools with your approval.


    Install & configure in Cursor

    1. Open settings → Features → MCP.
    2. Click + Add New MCP Server.
    3. Fill in:
      • Name: any friendly label (e.g., “Weather TS”).
      • Type: stdio or SSE.
      • Command / URL:
        • For stdio: a shell command that starts the server.
        • For SSE: the server’s SSE endpoint URL.
    4. Save. If tools don’t appear, click Refresh in the MCP pane.

    Example configurations

    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.


    Using the tools inside Composer

    Once the server is added:

    • The Composer Agent will auto-invoke relevant tools when your prompt implies them.
    • You can nudge usage by mentioning the tool name or describing its purpose.
    • Cursor will ask for approval before running a tool. You can inspect parameters, approve, and see the tool’s structured response inline.

    A quick smoke test

    Try prompts like:

    • “Use get_weather for Tokyo today and summarize.”
    • “Read the repo README via the filesystem resource, then propose a one-line improvement.”

    If you see an approval dialog and a response payload, you’re connected.


    Environment variables (wrapping stdio servers)

    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
    

    Designing tools that work well in Cursor

    • Name & describe clearly: models pick tools by name + description.
    • Keep inputs small & typed: prefer concise JSON schemas; validate early.
    • Return structure, not prose: let Cursor render; summarize only when needed.
    • Be safe by default: require approval for destructive operations; log everything.
    • Fail predictably: timeouts, retries, and helpful error messages.

    Troubleshooting

    SymptomLikely causeFix
    Tools don’t show upServer not running; stale listStart the server; click Refresh; check logs/console
    “Model can’t call tools”Current model lacks tool-useSwitch to a model that supports tool calling in Composer
    “Command not found”Wrong path/permissionsUse an absolute path; chmod +x wrapper; verify Node version
    SSE won’t connectWrong URL/CORS/TLSVerify URL, scheme (https:// if needed), and server SSE headers
    Tool runs but returns errorsInput mismatch/validationInspect arguments in approval dialog; align schema & prompt
    Tools slow or time outNetwork/DB slownessAdd timeouts and retries; paginate/stream large responses

    Advanced tips

    • Multiple servers: add one per domain (filesystem, search, CI, etc.).
    • Versioning: include a version in your server name (e.g., “Docs Search v0.3”).
    • Least privilege: read-only resources by default; narrow scopes for tools.
    • Observability: log inputs/outputs/errors with request IDs for debugging.
    • Compose flows: read a resource → call a tool → format with a prompt for clean handoffs.

    Uninstall or disable

    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.


    Wrap-up

    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.

    Wrap-up

    About the Author

    C
    Cursor Rules Pro Team
    Expert Development Team

    Expert developer passionate about modern web technologies and AI-assisted development.

    Popular Tags

    agents
    Cursor
    developer-tools
    LLM tools
    MCP
    tutorial
    cursor
    development

    Stay Updated

    Get the latest articles and tutorials delivered to your inbox.