Skip to content

Check your MCP server (CI)

If you build an MCP server, mcp-schema-bridge check tells you whether your tools will work in Gemini, OpenAI (standard and strict), and Claude before you ship.

Example: examples/server-builder/ (a realistic Pydantic server).

Terminal window
pip install "mcp-schema-bridge[cli]"
mcp-schema-bridge check --stdio -- python my_server.py # or: node build/index.js, uvx my-server, ...

By default, check tests all 5 targets side by side. fatal means a tool is unusable on that API. Each lossy or fatal entry prints a fix: line telling you what to change in your server:

openai-strict: 1 tool(s) ok, 1 rejected; ...
[fatal] create_contact /$defs/Contact/properties/metadata additionalProperties: an object without
declared properties (a map) cannot be expressed in strict mode (core/open-object-unsupported)
fix: declare the keys as properties, or model a map as a list of {key, value} objects
(Pydantic: list[KeyValue] instead of dict[str, str]) ...
Report says Change in your server
map / open object (dict[str, X], Record<string, X>, {type: object}) Declare properties, or use a list of {key, value} objects
minLength / pattern / minimum … “not enforced” Keep them, but also validate in your handler. The model may ignore them
optional + nullable “ambiguous” Give it default: null (Pydantic = None) if null means “not provided”
tool name invalid Use only letters, digits, _ and -, 64 characters or fewer
recursion only through required fields Make the recursive field optional or nullable

See every rule and fix in the Rule catalog.

Exits 1 if any tool hits the --fail-on threshold (fatal by default; use --fail-on lossy to catch constraints a model might ignore):

.github/workflows/mcp-schemas.yml
- run: pipx run --spec "mcp-schema-bridge[cli]" mcp-schema-bridge check --fail-on fatal --stdio -- python my_server.py

normalize_tools accepts official MCP SDK Tool objects (any Pydantic model) directly:

import asyncio
import pytest
from mcp_schema_bridge import TARGETS, normalize_tools
from my_server import server
@pytest.mark.parametrize("target", TARGETS)
def test_tools_work_everywhere(target):
result = normalize_tools(asyncio.run(server.list_tools()), target)
assert result.rejected == [], result.summary()

See API & CLI reference for all check flags and exit codes.