Skip to content

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.

Python (requires 3.11+, zero runtime dependencies):

Terminal window
pip install mcp-schema-bridge
pip install "mcp-schema-bridge[sdks]" # optional: payload adapters for google-genai / openai / anthropic
pip install "mcp-schema-bridge[cli]" # optional: --stdio and proxy support

TypeScript / JavaScript (requires Node >= 22, zero dependencies):

Terminal window
npm install mcp-schema-bridge

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

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.

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).args
assert server_args == {"query": "lamps"}
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" }
Terminal window
# Check a live MCP server across all 5 targets
mcp-schema-bridge check --stdio -- python my_server.py
# Normalize a tools.json file for a specific target
mcp-schema-bridge normalize tools.json --target gemini-json

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 error
  • reversible: The wire schema changed, and denormalize_args undoes it cleanly.
  • lossy: The target cannot enforce a constraint (like minLength in openai-strict). The constraint is restated in the field’s description so the model still sees it.