MCP servers

Declare stdio and HTTP MCP servers once and emit native config.

On this page

MCP servers are configuration, not code. ap-sdk emits native MCP config for harnesses that support it and warns for those that do not.

plugin.ts

import { definePlugin } from "@jalco/ap-sdk";

export default definePlugin({
  id: "repo-context",
  description: "Repository context MCP servers.",
  mcpServers: {
    github: {
      command: "npx",
      args: ["-y", "@modelcontextprotocol/server-github"],
      env: { GITHUB_TOKEN: "${GITHUB_TOKEN}" },
    },
    docs: {
      transport: "http",
      url: "https://docs.example.com/mcp",
      headers: { Authorization: "Bearer ${DOCS_TOKEN}" },
    },
  },
});

Fields

  • Stdio servers use command, args, env, and cwd.
  • HTTP servers use transport: "http", url, and headers.
  • Claude and Codex receive .mcp.json.
  • OpenCode receives opencode.json under the mcp key.

Next: tools and the support matrix.