@getmcp/generators
v0.10.1
Published
Config generators that transform canonical MCP server definitions to app-specific formats
Maintainers
Readme
@getmcp/generators
Config generators that transform canonical MCP server definitions into app-specific configuration formats for 19 AI applications.
Install
npm install @getmcp/generatorsUsage
Generate config for a specific app
import { generateConfig, getGenerator } from "@getmcp/generators";
// The first argument is the app ID, the second is the config key name
// (used as the key in the generated config object — typically a slug)
const config = generateConfig("claude-desktop", "github", {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_TOKEN: "ghp_xxx" },
});
// => { mcpServers: { github: { command: "npx", args: [...], env: {...} } } }
// Using generator instance directly
const generator = getGenerator("cursor");
const obj = generator.generate("github", { command: "npx", args: ["server"] });
const text = generator.serialize(obj);Generate config for ALL apps at once
import { generateAllConfigs } from "@getmcp/generators";
const configs = generateAllConfigs("github", {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_TOKEN: "ghp_xxx" },
});
// configs["claude-desktop"] => JSON string
// configs["goose"] => YAML string
// configs["vscode"] => JSON string (different root key + type field)
// ... all 19 appsIndividual generator classes
import {
ClaudeDesktopGenerator,
ClaudeCodeGenerator,
VSCodeGenerator,
CursorGenerator,
ClineGenerator,
RooCodeGenerator,
GooseGenerator,
WindsurfGenerator,
OpenCodeGenerator,
ZedGenerator,
PyCharmGenerator,
CodexGenerator,
GeminiCliGenerator,
ContinueGenerator,
AmazonQGenerator,
TraeGenerator,
BoltAiGenerator,
LibreChatGenerator,
AntigravityGenerator,
} from "@getmcp/generators";
const goose = new GooseGenerator();
const config = goose.generate("github", {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_TOKEN: "ghp_xxx" },
});
// => { extensions: { github: { cmd: "npx", args: [...], envs: {...} } } }
goose.serialize(config);
// => YAML stringSupported Apps
| App | Root Key | Format | Key Differences |
| ----------------- | ----------------- | ------ | ------------------------- |
| Claude Desktop | mcpServers | JSON | Canonical passthrough |
| Claude Code | mcpServers | JSON | type field for remote |
| VS Code / Copilot | servers | JSON | Requires type field |
| Cursor | mcpServers | JSON | Passthrough |
| Cline | mcpServers | JSON | alwaysAllow, disabled |
| Roo Code | mcpServers | JSON | alwaysAllow, disabled |
| Goose | extensions | YAML | cmd/envs keys |
| Windsurf | mcpServers | JSON | serverUrl for remote |
| OpenCode | mcp | JSONC | command is array |
| Zed | context_servers | JSON | Standard fields |
| PyCharm | mcpServers | JSON | Project-level config |
| Codex | mcp_servers | TOML | Array-style command |
| Gemini CLI | mcpServers | JSON | Near-passthrough |
| Continue | mcpServers | JSON | Near-passthrough |
| Amazon Q | mcpServers | JSON | Near-passthrough |
| Trae | mcpServers | JSON | Project-scoped |
| BoltAI | mcpServers | JSON | macOS only |
| LibreChat | mcpServers | YAML | YAML format |
| Antigravity | mcpServers | JSON | Passthrough |
API
| Export | Description |
| ------------------------------------- | -------------------------------------------------- |
| generators | Map of AppId to generator instances |
| getGenerator(appId) | Get a generator by app ID |
| getAppIds() | List all available app IDs |
| generateConfig(appId, name, config) | Generate config object for one app |
| generateAllConfigs(name, config) | Generate serialized config strings for all apps |
| BaseGenerator | Abstract base class for building custom generators |
License
MIT
