Integration

Generating an MCP snapshot

Snapshot a running MCP server, or write the snapshot by hand.

server.snapshot.json records an MCP server's tools, resources and prompts in a file you can commit. Sourcey builds its MCP reference from it.

Agent Plugins uses mcp.json at the plugin root for connection configuration: a $schema identifier and an mcpServers map. The snapshot holds the tools and their schemas. Keep the two files separate, and pass the snapshot to Sourcey's mcp() adapter.

From a running server

mcp-parser connects to a server, asks what it offers, and writes the answer:

npm install mcp-parser

stdio

npx mcp-parser snapshot --stdio "node my-server.js" -o server.snapshot.json

SSE

npx mcp-parser snapshot --sse http://localhost:3000/sse -o server.snapshot.json

Streamable HTTP

npx mcp-parser snapshot --http http://localhost:3000/mcp -o server.snapshot.json

Authentication

Pass headers for a server that needs them:

npx mcp-parser snapshot --http https://api.example.com/mcp \
  --header "Authorization:Bearer your-token" \
  -o server.snapshot.json

From an Agent Plugin

Use mcp-parser 0.4.3 or later to validate the plugin's connection configuration and snapshot a server by its name in mcpServers:

npx mcp-parser validate-config ./plugin/mcp.json
npx mcp-parser snapshot --config ./plugin/mcp.json --server api \
  -o server.snapshot.json

For a stdio entry, supply a persistent directory for that installed plugin's data. mcp-parser creates it if needed, provides PLUGIN_ROOT and PLUGIN_DATA, and expands those placeholders in args, env values and cwd:

npx mcp-parser snapshot --config ./plugin/mcp.json --server local \
  --plugin-data ./plugin-data/example -o server.snapshot.json

The plugin root defaults to the configuration file's directory. Config snapshots use mcp.snapshot.json when no output filename is given; the commands here name the file explicitly so the Sourcey config can use mcp("./server.snapshot.json").

By hand

The format follows the protocol's own definitions. A minimal snapshot:

{
  "mcpSpec": "0.3.2",
  "server": { "name": "my-server", "version": "1.0.0" },
  "description": "What this server does.",
  "tools": [
    {
      "name": "my_tool",
      "description": "What this tool does.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": { "type": "string", "description": "Search query" }
        },
        "required": ["query"]
      }
    }
  ]
}

mcpSpec names the version of the format the file follows. mcp-schema holds its full definitions and JSON Schema.

Checking it

npx mcp-parser validate ./server.snapshot.json
Valid: no issues found.

Validation checks required fields, duplicate names, missing descriptions and invalid schemas.

Markdown and context files

mcp-parser can also write a Markdown reference, or an llms.txt index or full export, from the snapshot alone:

npx mcp-parser generate ./server.snapshot.json -o mcp.md
npx mcp-parser generate ./server.snapshot.json --format llms-txt -o llms.txt
npx mcp-parser generate ./server.snapshot.json --format llms-full-txt -o llms-full.txt
Note

sourcey build writes llms.txt, llms-full.txt and each page's Markdown as part of the site. mcp-parser is for those files without a site.

Plugin connection configuration

If the snapshot includes transport hints, mcp-parser can write an Agent Plugins mcp.json from them:

npx mcp-parser generate ./server.snapshot.json --format agent-plugin \
  --server api -o ./plugin/mcp.json

Generation uses the explicit transport fields in the snapshot. It fails when required fields are missing or the hints do not satisfy the plugin format. Snapshots omit environment values and HTTP headers; author any required public settings in the plugin configuration and keep credentials out of it.