Target language
Generate the server in TypeScript (default) or Python.
klaridian generates the MCP server in TypeScript by default. Pass --language python to generate a Python server instead. Both languages produce the same tools, the same annotations, and the same observability behavior from the same OpenAPI spec—the choice is about the runtime you want to deploy and maintain.
TypeScript (the default)
npx klaridian generate --spec ./api.yaml --out ./my-serverThe generated project uses the official @modelcontextprotocol/server SDK. Run it with npm install && npm run build && npm start, or let klaridian prepare it for you with --install.
Python
npx klaridian generate --spec ./api.yaml --out ./my-server --language pythonThe generated project uses the official mcp Python SDK. It ships with a requirements.txt, a pyproject.toml, and a server.py entry point. Set it up and run it with:
cd ./my-server
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
export KLARIDIAN_BASE_URL=https://api.example.com
python server.pyOnce the virtual environment is prepared, klaridian start ./my-server launches the Python server too—it finds the project's .venv and runs server.py for you, the same single command that starts a TypeScript server.
For the network transport, add the flags to both the generate command and the run command:
npx klaridian generate --spec ./api.yaml --out ./my-server \
--language python --transport streamable-http --port 3000
python server.py --transport streamable-http --port 3000What's the same across both languages
- Tools. One tool per OpenAPI operation, with identical names and input schemas.
- Annotations. Read-only, destructive, idempotent, and open-world hints are computed the same way and appear the same way on the wire.
- Curation.
--include-tags,--exclude-tags, path and method filters all work the same—they act on the spec before either language emits. - Plugins. The
otel,posthog,amplitude, andmixpanelplugins all support both languages. Each ships as readable, vendored instrumentation source in the language you chose. - Environment contract. Both servers read
KLARIDIAN_BASE_URLfor the upstream host andKLARIDIAN_AUTH_TOKENfor a Bearer token. - Conformance. An unknown tool returns a JSON-RPC
-32602protocol error; invalid arguments return a tool-error result the model can read and react to.
What the Python target doesn't support yet
These are TypeScript-only for now:
--architecture code-mode. The Python code-mode target is planned separately.- OAuth (
--oauth-*). The Python resource-server support is a later addition. --install. The Python prepare step (virtual environment pluspip install) is planned separately. Follow the printed next steps to set the project up by hand.
klaridian fails with a clear message if you combine --language python with one of these, rather than generating a server that silently drops the feature.