Skip to main content

Discord

Badges
Build Nox semantic-release PyPI Read the Docs
Tests coverage pre-commit asv
Standards SemVer 2.0.0 Conventional Commits
Code uv Ruff Nox Checked with mypy
Repo GitHub issues GitHub stars GitHub license All Contributors Contributor Covenant

mcpgate

Welcome to mcpgate's documentation!

A stateless gateway that turns any OpenAPI spec into MCP tools on the fly.

Read the Docs

Installation

PyPI

mcpgate is available on PyPI:

# With uv
uv add mcpgate
# With pip
pip install mcpgate
# With Poetry
poetry add mcpgate

GitHub

You can also install the latest version of the code directly from GitHub:

# With uv
uv add git+https://github.com/MicaelJarniac/mcpgate
# With pip
pip install git+git://github.com/MicaelJarniac/mcpgate
# With Poetry
poetry add git+git://github.com/MicaelJarniac/mcpgate

Quick Start

Run the server directly without installing:

# With uv
uvx mcpgate
# With pipx
pipx run mcpgate

Usage

For more examples, see the full documentation.

from mcpgate import mcp

mcp.run(transport="http")

Examples

Nametag

Connect an MCP client to the Nametag API without any custom server code.

1. Start the gateway:

uvx --prerelease=allow mcpgate --port 8000

2. Configure your MCP client (e.g. Claude Desktop — claude_desktop_config.json):

{
  "mcpServers": {
    "Nametag": {
      "baseUrl": "http://localhost:8000/mcp/",
      "headers": {
        "X-OpenAPI-URL": "https://app.nametag.one/api/openapi.json",
        "X-API-URL": "https://app.nametag.one",
        "X-Cookies": "YOUR_SESSION_COOKIE"
      }
    }
  }
}

To get YOUR_SESSION_COOKIE, open the Nametag web app in your browser, open DevTools → Application → Cookies, and copy the value of the session cookie (e.g. __Secure-authjs.session-token=<value>). Pass it as X-Cookies: __Secure-authjs.session-token=<value>.

The gateway fetches the OpenAPI spec from X-OpenAPI-URL once and caches it, then proxies every MCP tool call to X-API-URL with your session cookie attached — no backend changes required.

Headers

mcpgate is configured per-request via HTTP headers sent by the MCP client:

Header Required Description
x-openapi-url Yes URL of the OpenAPI JSON specification to load
x-api-url Yes Base URL of the target API for proxied requests
x-cookies No Cookie string to forward with API requests

When both x-openapi-url and x-api-url are present, mcpgate fetches the OpenAPI spec, generates MCP tools from it, and proxies tool calls to the target API. When these headers are absent, the server returns no tools.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

More details can be found in CONTRIBUTING.

Contributors ✨

License

MIT

This project was created with the MicaelJarniac/crustypy template.

Release files for mcpgate 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcpgate 0.4.0
File Size Uploaded
mcpgate-0.4.0.tar.gz 113.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcpgate 0.4.0
File Interpreter ABI Platform
mcpgate-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 122.6 kB

Release files / mcpgate-0.4.0.tar.gz

Download URL mcpgate-0.4.0.tar.gz
Size 113.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ef3bceff2c741cbdc99c69d1b2ce349e1375f21cc2f7e3af2af9677c94f67798
BLAKE2b-256 checksum
How to use checksums
b854c05f2b45545155ade4d0af8f8b10ee36bfbd252c2876ac8ea62b04472c7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Release files / mcpgate-0.4.0-py3-none-any.whl

Download URL mcpgate-0.4.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63a64a18680c688bc18285e54d55d876a1d5c37794f2bbd13303032c69ad49af
BLAKE2b-256 checksum
How to use checksums
49391f2aa729f0876e679df5e307c10fcf6fbcec1991f4e6d0ef471eb5708ffa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page