Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
Tools
Model Context Protocol
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Connecting Letta to Local MCP Servers

stdio transport launches MCP servers as local subprocesses, ideal for development and testing. Local (stdio) MCP servers can be useful for local development, testing, and situations where the MCP server you want to use is only available via stdio.

ADE: Tool Manager → Add MCP Server → stdio → specify command and args

import { LettaClient } from "@letta-ai/letta-client";
// Self-hosted only
const client = new LettaClient({
baseUrl: "http://localhost:8283",
});
// Connect a stdio server (npx example - works in Docker!)
const stdioConfig = {
server_name: "github-server",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_PERSONAL_ACCESS_TOKEN: "your-token" },
};
await client.tools.addMcpServer(stdioConfig);
// List available tools
const tools = await client.tools.listMcpToolsByServer("github-server");
// Add a tool to use with agents
const tool = await client.tools.addMcpTool(
"github-server",
"create_repository",
);

Letta’s Docker image includes npx, so npm-based MCP servers work out of the box. Custom Python scripts or missing dependencies require workarounds.

  • Server won’t start: Check command path, dependencies, environment variables
  • Connection fails: Review Letta logs, test command manually
  • Tools missing: Verify MCP protocol implementation and tool registration