Quickstart
Go from raw MCP tools/list schemas to a working model call and round-tripped arguments in under 5 minutes.
No code to write? If you just want to fix an MCP server that breaks
gemini-cli, Claude Desktop, or Cursor, use the zero-code proxy.
1. Install
Section titled “1. Install”Python (requires 3.11+, zero runtime dependencies):
pip install mcp-schema-bridgepip install "mcp-schema-bridge[sdks]" # optional: payload adapters for google-genai / openai / anthropicpip install "mcp-schema-bridge[cli]" # optional: --stdio and proxy supportTypeScript / JavaScript (requires Node >= 22, zero dependencies):
npm install mcp-schema-bridge2. Pick a target
Section titled “2. Pick a target”Choose the target that matches the model API you send tools to:
| Model API | Target | Notes |
|---|---|---|
Gemini (google-genai, Vertex, AI Studio, gemini-cli) |
gemini-json |
Targets parametersJsonSchema |
OpenAI Structured Outputs (strict: true, Responses API, Agents SDK) |
openai-strict |
Enforces closed objects & all-required properties |
OpenAI standard function tools (strict: false) |
openai |
Minimal rewrites |
Claude (strict: true) |
anthropic-strict |
Enforces strict grammar & per-request budgets |
| Claude (standard tools) | anthropic |
Minimal rewrites |
3. Normalize tools and map arguments back
Section titled “3. Normalize tools and map arguments back”Suppose your MCP server exposes a search tool with an optional limit parameter (minimum: 1, maximum: 50) and a query parameter (minLength: 1).
In openai-strict mode, OpenAI rejects schemas unless every property is listed in required and additionalProperties is false. mcp-schema-bridge rewrites the schema, reports what changed, and denormalize_args / denormalizeArgs restores the original argument shape before you call the MCP server.
Python
Section titled “Python”from mcp_schema_bridge import NormalizeOptions, denormalize_args, normalize_tools
tools = [ { "name": "search", "description": "Search the catalogue", "inputSchema": { "type": "object", "properties": { "query": {"type": "string", "minLength": 1}, "limit": {"type": "integer", "minimum": 1, "maximum": 50}, }, "required": ["query"], }, }]
result = normalize_tools(tools, "openai-strict", NormalizeOptions(strict_fallback=True))print(result.summary())
# Send result.tools (or to_sdk_payload(result, "openai-responses")) to the model.# Suppose the model omits `limit` by sending `null` (because strict mode made it required):model_args = {"query": "lamps", "limit": None}
tool = result.get("search")server_args = denormalize_args(tool, model_args).argsassert server_args == {"query": "lamps"}TypeScript
Section titled “TypeScript”import { denormalizeArgs, normalizeTools } from "mcp-schema-bridge";
const tools = [ { name: "search", description: "Search the catalogue", inputSchema: { type: "object", properties: { query: { type: "string", minLength: 1 }, limit: { type: "integer", minimum: 1, maximum: 50 }, }, required: ["query"], }, },];
const result = normalizeTools(tools, "openai-strict", { strictFallback: true });console.log(result.summary());
// Send result.tools (or toSdkPayload(result, "openai-responses")) to the model.// Suppose the model omits `limit` by sending `null`:const modelArgs = { query: "lamps", limit: null };
const tool = result.get("search")!;const serverArgs = denormalizeArgs(tool, modelArgs).args;// -> { query: "lamps" }CLI (no code)
Section titled “CLI (no code)”# Check a live MCP server across all 5 targetsmcp-schema-bridge check --stdio -- python my_server.py
# Normalize a tools.json file for a specific targetmcp-schema-bridge normalize tools.json --target gemini-json4. What the report tells you
Section titled “4. What the report tells you”Running result.summary() prints one line per non-info change, plus actionable fix: hints:
openai-strict: 1 tool(s) ok, 0 rejected; 1 info, 1 reversible, 1 lossy [reversible] search /properties/limit type: optional property 'limit' made required and nullable; null is removed again by denormalize_args (openai-strict/optional-to-nullable) [lossy] search /properties/query minLength: minLength is not supported by the target; kept as a description hint (openai-strict/keyword-unsupported) fix: the model may not respect this constraint: validate it in your tool handler and return a helpful errorreversible: The wire schema changed, anddenormalize_argsundoes it cleanly.lossy: The target cannot enforce a constraint (likeminLengthinopenai-strict). The constraint is restated in the field’s description so the model still sees it.
Next steps
Section titled “Next steps”- Building an MCP server? Gate your schemas in CI with Check your MCP server (CI).
- Building an agent or MCP client? Wire
to_sdk_payloadanddenormalize_argsinto your tool loop with Normalize in your agent loop. - Using an off-the-shelf MCP client? Put the zero-code proxy in front of any broken server.
- Want to test your own schema right now? Paste it into the interactive Playground.