Turn Python code into REST APIs and MCP tools
Make your Python functions available to applications and AI assistants. Apizr reads your code, lets you choose what to share, and generates a REST API or an MCP server. Your business logic stays in Python.
MCP (Model Context Protocol) lets AI assistants discover and use tools.
Apizr 0.4.4 is available. Python 3.11–3.14 · Open source, GPL-3.0-or-later.
Start with two Python functions and make your first calls in the Quickstart. The core is enough: no plugin, Docker or AI account is needed for its REST and Python MCP examples.
From Python code to REST and MCP
Bring existing Python expertise into your applications and AI workflows. See how Apizr turns a route optimizer into callable interfaces.
English narration · English captions
Read the transcript
Put your business logic to work. For an operations team, time on the road matters. Your Python code already plans better routes. Apizr helps make that expertise available to the people and systems that need it.
Keep the expertise you already have. Here, a specialist has prepared a route optimizer in a notebook. The next step is to connect it to the dispatch application, using the same calculation.
Understand what you can expose. First, inspect the notebook with Apizr. It identifies the functions and reports which can generate an interface. Your team chooses the capability to make available.
Connect your operational applications. Select the route optimizer and generate REST. Apizr creates the application and its API contract. The dispatch system now has an interface it can call.
Generated code your team can inspect. These are the generated files. Your developers can inspect and run them. The adapter connects incoming requests to your existing function, keeping the business calculation in one place.
Put the generated API to work. Start the generated application and send a list of stops. The response contains a proposed route and its driving estimate. This is what the dispatch interface will use.
See the operational impact. Now the result becomes visible. On this eight-stop example, the estimated driving time drops from about one hundred and one minutes to forty eight.
Adapt when the workload changes. For a different twelve-stop tour, call the same API again. The route changes, with a fifty four percent improvement over this starting order. These estimates do not include live traffic.
Make the same capability available to AI. Next, use Apizr to generate an MCP server from the same function. An assistant can use the existing calculation as a tool, rather than estimate the route itself.
Turn a business request into an action. Ask Ollama to add the Pantheon while keeping the existing stops. Our local interface passes the generated tool definition to the model, then forwards its chosen call through MCP.
The same logic serves another channel. The tool returns a thirteen-stop tour. The map updates from that result. The application and the assistant now use the same underlying business logic.
Existing expertise. New applications. Inspect your Python. Choose what to expose. Generate REST and MCP interfaces with Apizr. Bring existing expertise into your applications and AI workflows.
Choose your next step
- Make your first calls — turn Python functions into REST endpoints or MCP tools.
- Explore a project with an AI assistant — use Apizr's optional analysis plugin.
- Package a service for deployment — build a container image and publish it to your registry.
See the installation guide for package availability and optional plugins.
Choose what becomes public
Apizr scans code without executing it and tells you which functions it can turn into an interface. You choose which ones become public. Their private helpers can be included without becoming endpoints or tools.
The generated bundle contains the server, its API or tool definitions and the source it needs. Start with REST endpoints or MCP tools, then use your own repository.
Decide how calls execute
The Quickstart runs trusted functions inside the generated server. For fresh workers, timeouts or container execution, continue with execution policies. Running a generated server executes your Python code; static analysis does not make unfamiliar code safe to run.
Tools using Apizr
- Trunx — a private registry for software packages and container images. Trunx uses Apizr to publish REST and MCP services within its deployment approval workflow.
Explore the MCP ecosystem
Find Apizr's analysis plugin on Glama and the official MCP Registry. It helps an assistant explore your project. To let an assistant call your own functions, follow the MCP guide.
Watch the tutorials throughout these guides or visit Alien6 Studio on YouTube.
Want to improve Apizr? The contributor guide covers development setup, tests and pull requests.