Local MCP Installation
Install and test a local MCP server with stdio, package managers, environment variables, and safe logs.
Quick Answer / TL;DR
A local MCP server runs as a child process and exchanges JSON-RPC messages over stdin and stdout. Keep logs on stderr and keep secrets in environment variables.
Key Takeaways
- Use stdio for local testing.
- Do not print debug logs to stdout.
- Validate the server with one safe read-only tool first.
Install and run
Local installation is the fastest way to learn MCP. Create a small TypeScript or Python server, expose one harmless tool, and point your client configuration at the command that starts it.
The most common local failure is corrupting stdout with log output. The MCP stream expects JSON-RPC frames, so debugging output should go to stderr.
npm init -y
npm install @modelcontextprotocol/sdk zod
node server.jsDesktop client configuration
Claude Desktop and Cursor read server definitions from JSON configuration. Use absolute commands when possible and place secrets in the env block instead of source code.
{
"mcpServers": {
"local-notes": {
"command": "node",
"args": ["/Users/me/mcp/local-notes/server.js"],
"env": {
"NOTES_DIR": "/Users/me/Documents/notes"
}
}
}
}Local MCP Installation FAQs
Direct answers for developers, operators, and Indian teams evaluating MCP.