nativegate
agentic integration for legacy native code

Make legacy Fortran and C++
AI-ready and microservice-ready,
without rewriting it.

Your validated numerical code is the most valuable thing an AI agent can't reach. nativegate wraps it as an MCP server and REST API, so Claude, Cursor and any agentic client can call it as a tool today — with a recorded numerical baseline that helps verify the answers do not change.

the numerics stay compiled and untouched. every step is a plain ngate command.
petro_api — zsh
$ ngate quickstart libraries/petro/pvt.f90 detect fortran, fixed-form F77 decks under an F90 facade generate pybind-style f2py bindings, CMake, python package build compiling extension... done golden recording baseline for 10 exposed routines... done $ ngate serve petro_api uvicorn running on http://127.0.0.1:8000 mcp endpoint at http://127.0.0.1:8000/mcp $ curl localhost:8000/healthz {"status":"ok"}

Four stages, each one a command you can run yourself.

Nothing in the console does anything the CLI can't do on its own — the web app just runs ngate for you and shows you the output as it happens.

01 / discover Discover Detect the language and dialect, list the symbols a file offers, and flag what would be skipped before you commit to anything.
02 / generate Generate Produce the pybind11 or f2py bindings, the CMake build, an installable Python package, tests, and a FastAPI service.
03 / build Build Compile the extension inside a non-root, network-isolated container — a compiler nativegate doesn't control never touches your host.
04 / verify Verify Record the numbers the bindings currently return, then fail the build if a future regeneration moves them.

The numerics stay exactly where they are.

Modernization here means the interface, the packaging, and the deployment — not a rewrite. The Fortran or C++ underneath is unchanged and provably so.

REST

A live HTTP service

Every exposed routine becomes an endpoint on an ordinary FastAPI app, shipped in an ordinary wheel — nothing exotic to deploy.

MCP

An MCP endpoint, for free

The same generated service exposes your native routines as tools an LLM agent can call directly, with descriptions carried over from your source comments.

Golden records

Answers that can't drift

ngate golden record captures what the bindings return today; ngate verify fails the build the moment a regeneration changes an answer.

Isolation

A compiler you don't have to trust

Builds run non-root and network-isolated in a container. A malicious or broken build script can't reach your host or the network.

No hand-written glue

Bindings, generated

pybind11 for C++, f2py for Fortran, CMake wiring, the Python package layout — all produced from what your source actually declares.

One CLI

From header to container

detect, generate, build, verify, serve, docker — the whole path is one binary, scriptable, no web app required.

Your coding agent gets the native library as a tool, in one command.

Every generated service already speaks MCP. Pointing an agentic coding platform at it is a config entry, not an integration project.

adding petro_api to an MCP client
$ ngate serve petro_api mcp endpoint at http://127.0.0.1:8000/mcp $ claude mcp add --transport http petro_api http://127.0.0.1:8000/mcp added mcp server "petro_api" to ~/.claude.json or by hand, in any MCP-config-driven client: { "mcpServers": { "petro_api": { "url": "http://127.0.0.1:8000/mcp" } } }
Claude Code

claude mcp add

One line — claude mcp add --transport http petro_api http://127.0.0.1:8000/mcp — and every exposed routine shows up as a tool.

Cursor / Windsurf

Drop into mcp.json

Same URL, same shape — paste it into .cursor/mcp.json or the Windsurf MCP panel and the routines show up as callable tools.

Any MCP client

No SDK to write against

It's a standard streamable-HTTP MCP endpoint — no custom client, no auth dance, no generated stubs to keep in sync with the source.

One binary, from legacy source to running container.

ngate --help is authoritative — this is the shape of it.

ngate --help (abridged)
survey detect, suggest, inspect — what's in this tree, what's worth exposing scaffold init, create-service, quickstart — stand up services/ generate generate, build, lock — bindings, compile, pin deps verify golden record, verify, test — catch numeric drift ship serve, docker, k8s, gateway — run it, containerize it, mount it behind a gateway

Point it at a header or a deck. See what comes back.