How to connect an MCP server to a client
Using MCP as an end user or developer starts with connecting a server to a client such as Claude Desktop, an IDE, or your own agent. The mechanics are the same everywhere: you tell the client how to reach the server.
Local servers: a command to run #
A local server runs as a subprocess on your machine and talks to the client over standard input and output (stdio). You give the client a command, its arguments, and any environment variables. In Claude Desktop this lives in a JSON config file:
json{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"],
"env": {}
}
}
}Restart the client and the server's tools appear. The Reference servers repo lists ready-made servers you can drop in this way.
Remote servers: a URL #
A remote server runs somewhere else and is reached over HTTP. Instead of a command you give a URL, and usually an authorization step. Remote servers are how a team shares one hosted integration across many users.
json{
"mcpServers": {
"example": {
"url": "https://mcp.example.com/mcp"
}
}
}
Verify the connection #
After adding a server, confirm the client actually connected and the tools are listed. If nothing shows up, the fastest way to isolate the problem is the MCP Inspector, which connects to a server directly so you can see whether the fault is the server or the client config.
Resources & further reading
- modelcontextprotocol.io MCPThe official Model Context Protocol site: concepts, quickstarts, and client list.
- Reference servers GitHubA collection of official and community MCP servers you can install and learn from.