Skip to content

Getting Started with MCP

Whether you’re looking to build an application that provides context to LLMs (as a Server Developer), integrate LLM context into your application (as a Client Developer), or use an MCP-enabled application, this guide provides a starting point.

As a Server Developer, your goal is to expose contextual information and capabilities from your application, data source, or service via the Model Context Protocol.

  • Understand the Core Concepts: Familiarize yourself with MCP Resources, Prompts, and Tools. Decide what data (Resources), pre-defined interactions (Prompts), and actions (Tools) your service can offer to an LLM.
  • Choose an SDK: Select an MCP Server SDK in your preferred language (e.g., TypeScript, Python). These SDKs provide the necessary tools to implement the MCP protocol, handle requests, and manage connections.
  • Define Your Capabilities: Design and implement how your server will expose its Resources, Prompts, and Tools. This involves mapping your internal data and functions to the MCP abstractions.
    • Resources: Implement logic to list and provide content for resources (e.g., exposing files from a workspace, rows from a database).
    • Prompts: Create prompt templates or dynamic prompt generators relevant to your server’s domain.
    • Tools: Implement functions that can be called by the LLM, ensuring they are secure and well-defined.
  • Implement the Server: Write the server logic using the chosen SDK. This includes setting up the server endpoint (e.g., WebSocket server), handling incoming JSON-RPC messages, and routing them to your capability implementations.
  • Test Your Server: Use an MCP Client or a dedicated testing tool (like the MCP Inspector, if available) to connect to your server, discover its capabilities, and test its responses.
  • Document and Publish: Provide clear documentation for your server’s capabilities so Client developers and users can understand how to use it.

Think about exposing your project’s file system as resources, or your application’s internal state. Tools could include running build commands or fetching data from a specialized API.

As a Client Developer, you’ll be building applications (Hosts) or plugins that consume information and capabilities from MCP Servers to enhance LLM interactions.

  • Understand Client Responsibilities: Your client will need to discover MCP Servers, connect to them, make requests for Resources, Prompts, and Tools, and handle responses.
  • Choose an SDK: Select an MCP Client SDK suitable for your application’s language (e.g., TypeScript, Python).
  • Server Discovery & Connection: Implement logic to discover and connect to MCP Servers. This might involve pre-configured server addresses or dynamic discovery mechanisms.
  • Interact with Servers: Use the SDK to:
    • List and retrieve Resources to provide context to the LLM.
    • Implement Sampling strategies to select relevant parts of resources.
    • Discover and utilize server-defined Prompts to guide LLM interactions.
    • Allow the LLM to request execution of Tools and handle their results.
  • Integrate with LLM: Pass the context obtained via MCP to your LLM. Interpret LLM requests that might translate into MCP tool calls or resource queries.
  • Manage State and UI: If your client is part of a user-facing application, manage the display of contextual information and provide UI elements for interacting with MCP capabilities.
  • Error Handling and Resilience: Implement robust error handling for network issues, server errors, or unexpected responses.

Your IDE plugin could be an MCP client, fetching context about the open project from a local MCP server to provide to an AI coding assistant.

If you are using an application like Claude Desktop that has built-in MCP support, getting started usually involves configuring it to connect to available MCP Servers.

  • Check for MCP Support: Ensure your version of Claude Desktop (or similar Host application) supports MCP. Refer to its documentation.
  • Discover/Add MCP Servers: The application might automatically discover local MCP servers, or you may need to add server addresses manually in its settings. For example, if you’ve developed a local MCP server for your codebase, you’d point Claude Desktop to its address (e.g., ws://localhost:3000).
  • Enable MCP Integration: There might be a setting within the application to enable or disable MCP context sources.
  • Utilize Context in Prompts: Once connected, the application should be able to leverage the context from the MCP server when you interact with the LLM. This might manifest as more relevant answers, better suggestions, or the ability for the LLM to ‘see’ your local files or data.
  • Explore Exposed Capabilities: The Host application might provide a UI to browse available Resources, Prompts, or Tools from connected MCP Servers, allowing you to understand what context the LLM can access.

The specifics can vary greatly depending on how the Host application (like Claude Desktop) implements MCP client functionality. Always refer to the application’s specific documentation for detailed instructions.