Skip to main content
Glama
flask-mcp-native

flask-mcp-native

by nazil561
README.md
# flask-mcp-native

> Expose a Flask application as an MCP server with one line of code.

[![PyPI version](https://img.shields.io/pypi/v/flask-mcp-native.svg)](https://pypi.org/project/flask-mcp-native/)
[![Python versions](https://img.shields.io/pypi/pyversions/flask-mcp-native.svg)](https://pypi.org/project/flask-mcp-native/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[![tests](https://github.com/nazil561/flask-mcp-native/actions/workflows/test.yml/badge.svg)](https://github.com/nazil561/flask-mcp-native/actions/workflows/test.yml)

**Status:** `v0.1.0` — early release. Core is tested. See [Limitations](#limitations-v010) before production use.

---

## Why this exists

The [Model Context Protocol](https://modelcontextprotocol.io) (MCP) lets AI agents call your application's functions as tools. FastAPI got its integration first — [`fastapi-mcp`](https://github.com/tadata-org/fastapi_mcp) has 11k+ stars. Flask did not.

| Feature | `fastapi-mcp` (FastAPI) | `flask-mcp-native` (Flask) |
| :--- | :--- | :--- |
| Route auto-discovery | ✅ | ✅ |
| Typed tool arguments | ✅ | ✅ (from URL converters) |
| stdio transport | ✅ | ✅ |
| HTTP/SSE transport | ✅ | 🔜 roadmap |
| Auth | ✅ | 🔜 roadmap |
| Framework | FastAPI (ASGI) | Flask (WSGI) |

The alternative was: migrate to FastAPI, or hand-write an MCP server duplicating every route. This is the third option — keep Flask, get MCP.

---

## Installation

```bash
pip install flask-mcp-native