Connect to MCP (Model Context Protocol) servers and create skills for repeated use. Load when a user wants to use an MCP server, connect to external tools via MCP, or when they mention MCP, model context protocol, or specific MCP servers.
Letta Code is not itself an MCP client, but as a general computer-use agent, you can easily connect to any MCP server using the scripts in this skill.
MCP (Model Context Protocol) is a standard for exposing tools to AI agents. MCP servers provide tools via JSON-RPC, either over:
http://localhost:3001/mcp)Ask the user:
npx, node, python)?For HTTP servers:
npx tsx <skill-path>/scripts/mcp-http.ts <url> list-tools
# With auth header
npx tsx <skill-path>/scripts/mcp-http.ts <url> --header "Authorization: Bearer KEY" list-tools
For stdio servers:
# First, install dependencies (one time)
cd <skill-path>/scripts && npm install
# Then connect
npx tsx <skill-path>/scripts/mcp-stdio.ts "<command>" list-tools
# Examples
npx tsx <skill-path>/scripts/mcp-stdio.ts "npx -y @modelcontextprotocol/server-filesystem ." list-tools
npx tsx <skill-path>/scripts/mcp-stdio.ts "python server.py" list-tools
# List all tools
... list-tools
# Get schema for a specific tool
... info <tool-name>
# Test calling a tool
... call <tool-name> '{"arg": "value"}'
When an MCP server will be used repeatedly, create a dedicated skill for it. This makes future use easier and documents the server's capabilities.
Simple skill (just SKILL.md):
Rich skill (SKILL.md + scripts/):
See references/skill-templates.md for templates.
Connects to MCP servers over HTTP. No dependencies required.
npx tsx mcp-http.ts <url> [options] <command> [args]
Commands:
list-tools List available tools
list-resources List available resources
info <tool> Show tool schema
call <tool> '<json>' Call a tool
Options:
--header "K: V" Add HTTP header (repeatable)
--timeout <ms> Request timeout (default: 30000)
Examples:
# Basic usage
npx tsx mcp-http.ts http://localhost:3001/mcp list-tools
# With authentication
npx tsx mcp-http.ts http://localhost:3001/mcp --header "Authorization: Bearer KEY" list-tools
# Call a tool
npx tsx mcp-http.ts http://localhost:3001/mcp call vault '{"action":"search","query":"notes"}'
Connects to MCP servers that run as subprocesses. Requires npm install first.
# One-time setup
cd <skill-path>/scripts && npm install
npx tsx mcp-stdio.ts "<command>" [options] <action> [args]
Actions:
list-tools List available tools
list-resources List available resources
info <tool> Show tool schema
call <tool> '<json>' Call a tool
Options:
--env "KEY=VALUE" Set environment variable (repeatable)
--cwd <path> Set working directory
--timeout <ms> Request timeout (default: 30000)
Examples:
# Filesystem server
npx tsx mcp-stdio.ts "npx -y @modelcontextprotocol/server-filesystem ." list-tools
# With environment variable
npx tsx mcp-stdio.ts "node server.js" --env "API_KEY=xxx" list-tools
# Call a tool
npx tsx mcp-stdio.ts "python server.py" call read_file '{"path":"./README.md"}'
Here are some well-known MCP servers:
| Server | Transport | Command/URL |
|---|---|---|
| Filesystem | stdio | npx -y @modelcontextprotocol/server-filesystem <path> |
| GitHub | stdio | npx -y @modelcontextprotocol/server-github |
| Brave Search | stdio | npx -y @modelcontextprotocol/server-brave-search |
| obsidian-mcp-plugin | HTTP | http://localhost:3001/mcp |
"Cannot connect" error:
"Authentication required" error:
--header "Authorization: Bearer YOUR_KEY" for HTTP--env "API_KEY=xxx" for stdio servers that need env varsstdio "npm install" error:
cd <skill-path>/scripts && npm install firstTool call fails:
info <tool> to see the expected input schemaControl Philips Hue lights and scenes via the OpenHue CLI.