Skip to content
Development
Skill

/converting-mcps-to-skills

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.

From plugin
letta-code
3k20 skills8 hooks
Install
$ npx -y skills add letta-ai/letta-code --skill converting-mcps-to-skills --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/converting-mcps-to-skills

Context preview

The summary Claude sees to decide when to auto-load this skill.

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.

SKILL.md

converting-mcps-to-skills.SKILL.md
name: converting-mcps-to-skills
description: 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.

Converting MCP Servers to Skills

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.

What is MCP?

MCP (Model Context Protocol) is a standard for exposing tools to AI agents. MCP servers provide tools via JSON-RPC, either over:

  • **HTTP** - Server running at a URL (e.g., `http://localhost:3001/mcp`)
  • **stdio** - Server runs as a subprocess, communicating via stdin/stdout

Quick Start: Connecting to an MCP Server

Step 1: Determine the transport type

Ask the user:

  • Is it an HTTP server (has a URL)?
  • Is it a stdio server (runs via command like `npx`, `node`, `python`)?

Step 2: Test the connection

**For HTTP servers:**

npx tsx <SKILL_DIR>/scripts/mcp-http.ts <url> list-tools

# With auth header
npx tsx <SKILL_DIR>/scripts/mcp-http.ts <url> --header "Authorization: Bearer KEY" list-tools

Where `<SKILL_DIR>` is the Skill Directory shown when the skill was loaded (visible in the injection header).

**For stdio servers:**

npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "<command>" list-tools

# Examples
npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "npx -y @modelcontextprotocol/server-filesystem ." list-tools
npx tsx <SKILL_DIR>/scripts/mcp-stdio.ts "python server.py" list-tools

Step 3: Explore available tools

# List all tools
... list-tools

# Get schema for a specific tool
... info <tool-name>

# Test calling a tool
... call <tool-name> '{"arg": "value"}'

Creating a Dedicated Skill

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.

Decision: Simple vs Rich Skill

**Simple skill** (just SKILL.md):

  • Good for straightforward servers
  • Documents how to use the parent skill's scripts with this specific server
  • No additional scripts needed

**Rich skill** (SKILL.md + scripts/):

  • Good for frequently-used servers
  • Includes convenience wrapper scripts with defaults baked in
  • Provides a simpler interface than the generic scripts

See `references/skill-templates.md` for templates.

Built-in Scripts Reference

mcp-http.ts - HTTP Transport

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
  login                   Run OAuth flow and cache tokens for this server
  logout                  Clear cached OAuth tokens for this server

Options:
  --header "K: V"         Add HTTP header (repeatable). Disables auto-OAuth.
  --auth <mode>           "auto" (default), "oauth", or "none"
  --timeout <ms>          Request timeout (default: 30000)

**Examples:**

# Basic usage
npx tsx mcp-http.ts http://localhost:3001/mcp list-tools

# With static bearer authentication
npx tsx mcp-http.ts http://localhost:3001/mcp --header "Authorization: Bearer KEY" list-tools

# OAuth-protected server (opens a browser to sign in, then caches tokens)
npx tsx mcp-http.ts https://example.com/mcp login
npx tsx mcp-http.ts https://example.com/mcp list-tools

# Call a tool
npx tsx mcp-http.ts http://localhost:3001/mcp call vault '{"action":"search","query":"notes"}'

**OAuth support:** When a server returns `401 WWW-Authenticate: Bearer ...` and no static `Authorization` header was supplied, `mcp-http.ts` will automatically:

1. Discover the authorization server via `resource_metadata`, the `realm=` param, or the server's own origin (`.well-known/oauth-authorization-server` then `.well-known/openid-configuration`). 2. Dynamically register a public client with PKCE (`token_endpoint_auth_method: none`). 3. Open the system browser to the authorization endpoint, catch the redirect on a `127.0.0.1` loopback port, and exchange the code for tokens. 4. Cache the token set (and the registered client) at `~/.letta/mcp-oauth/<host>_<path>.json` with `0600` perms. 5. Auto-refresh expired access tokens using the stored refresh token before each request; if refresh fails, it re-runs the browser flow once.

Use `login` to run the flow explicitly (e.g. as a first step in a skill's setup) and `logout` to clear cached tokens. Passing an explicit `--header "Authorization: ..."` disables auto-OAuth so you stay in control. Pass `--auth none` to force static-only behavior.

mcp-stdio.ts - stdio Transport

Connects to MCP servers that run as subprocesses. No dependencies required.

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"}'

Common MCP Servers

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

Read more
Ships withletta-code

Letta Code is a stateful agent harness for creating agents that are more like people than tools. Letta Code agents have memory, identity, and a sense of experience over time.

Get the whole plugin

Other skills on letta-code.