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, andcwd. - HTTP servers use
transport: "http",url, andheaders. - Claude and Codex receive
.mcp.json. - OpenCode receives
opencode.jsonunder themcpkey.
Next: tools and the support matrix.
On this page