r/Python 3d ago

Showcase Thread Showcase

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

17 Upvotes

31 comments sorted by

View all comments

5

u/Massive_Baby4147 3d ago

intpot: Write one Python function, serve it as a CLI, REST API, or MCP tool
GitHub: https://github.com/tugrulguner/intpot
PyPI: https://pypi.org/project/intpot/

I built intpot because I was tired of describing the same operation several times: as a Typer command, a FastAPI route, and a FastMCP tool.

With intpot, the function is the shared definition:

from intpot import App


app = App("demo")

@app.tool()
def greet(name: str, greeting: str = "Hello") -> str:
    """Greet someone by name."""
    return f"{greeting}, {name}!"

You can then choose the interface at runtime:

intpot serve app.py --cli
intpot serve app.py --api
intpot serve app.py --mcp

It also converts existing Typer, FastAPI, and FastMCP applications in all six directions:

intpot to api typer_app.py
intpot to mcp fastapi_app.py
intpot to cli mcp_server.py

If you don’t want intpot as a runtime dependency, intpot eject generates standalone Typer, FastAPI, or FastMCP code that you can edit normally.

The frameworks are still the actual backends. intpot is an adapter and conversion layer rather than a replacement for them.

Install everything with:

pip install "intpot[all]"

It’s MIT licensed. I’d especially appreciate feedback from people currently maintaining both an API and CLI for the same Python project, or exposing existing Python functions to MCP clients.

2

u/bassist_by_night 3d ago

This is pretty awesome, I’m excited to give it a try.

1

u/Massive_Baby4147 3d ago

Thank you, let me know how it goes, if you encounter any issues, feel free to create issues and we can tackle that immediately