Agentic AI Notebook
Model Context Protocol
Phase 8Module 14 of 25

Local MCP

Some data should never go to a cloud MCP server. Local stdio keeps files on disk and latency near zero.

Local MCP is a home workshop. The tools are on your bench. Nothing is shipped to a warehouse.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

Overview

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

How Cursor attaches a local server

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

The host owns the child process. If the process dies, reconnect or restart the host.

Key Takeaways

  • 1.Local MCP runs on your machine as a child process over stdio. The client starts a command from mcp.json and talks on stdin/stdout.
  • 2.Best for source code, .env files, and local databases that must not leave. No OAuth needed — your OS user permissions are the security boundary.
  • 3.stdio means one JSON-RPC message per line. Logs belong on stderr.
  • 4.Point filesystem servers at a project folder, never the whole home directory, unless you truly mean that.

Learn elsewhere

  • Remote HTTP servers — next module
  • OAuth — Authentication

Real Example

Scenario

Cursor spawns @modelcontextprotocol/server-filesystem on your repo root. The agent can read and write project files without a network round trip.

What you would do

In Model Context Protocol, apply Local MCP to this scenario: Cursor spawns @modelcontextprotocol/server-filesystem on your repo root. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • npx -y @modelcontextprotocol/server-filesystem <folder>
  • Logs go to stderr, never stdout
  • Scope the directory tightly
  • stdio = local child process

Cheat Sheet

Quick recap

quick ref
  • Local = stdio child process
  • Configured in mcp.json
  • Great for files and local DBs
  • OS permissions are your auth

Common Mistakes

  • Pointing the filesystem server at the entire disk
  • console.log on stdout breaking JSON-RPC
  • Assuming local MCP is reachable from another computer