FastAPI backend template with an MCP Streamable HTTP server

FastAPI backend template with an MCP Streamable HTTP server

mcp-rest-sample•bybeaverhouse

A small backend template that serves a mock project and ticket domain through both REST endpoints and an MCP server at /mcp using Streamable HTTP, with MCP tools, resources, and prompts.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Exposes one mock domain through both REST endpoints and MCP, covering health, projects, ticket triage, and release notes on the REST side and matching project/ticket tools and resources over MCP.
  • •Provides MCP tools, resources, and prompts defined in an mcp_server module wired into the FastAPI app.
  • •Runs the MCP endpoint as stateless HTTP over Streamable HTTP, targeting the MCP Python SDK v2 beta.
  • •Keeps mock data in memory, leaving persistence to be added once REST and MCP boundaries are clear.

BEST FOR

  • •Developers building a backend that needs to serve both API clients over REST and agents over MCP from a single service.
  • •Learning how to structure a FastAPI app with an MCP Streamable HTTP endpoint and matching tools and resources.

ABOUT MCP-REST-SAMPLE

FastAPI backend template with an MCP Streamable HTTP server is cataloged as an MCP server attributed to beaverhouse. A small backend template that serves a mock project and ticket domain through both REST endpoints and an MCP server at /mcp using Streamable HTTP, with MCP tools, resources, and prompts. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for FastAPI backend template with an MCP Streamable HTTP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Is this sample intended for production use?

No. The README describes it as a template and learning sample rather than a production MCP compatibility claim.

Does the sample implement OAuth or OpenID Connect discovery?

No. The sample does not implement OAuth or OpenID Connect discovery, and .well-known probe requests can return 404 in this local sample.

Upstream README

View this exact version on GitHub

README.md · de05ccec7284 · Fetched 2026-11-13 11:01:31 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Logo

FastAPI backend template with MCP Streamable HTTP.

Python FastAPI uv MCP License

Description

This repository is a small backend template for services that need both:

  • human/API-client access through REST endpoints
  • agent access through MCP (Model Context Protocol) tools, resources, and prompts

The app exposes one mock domain through both surfaces:

  • REST: /health, /projects, /projects/{project_id}, ticket triage, release notes
  • MCP: /mcp using Streamable HTTP, with matching project/ticket tools and resources

The mock data is intentionally in memory. Add a database only after the REST and MCP boundaries are clear.

MCP Status

This template targets the MCP Python SDK v2 beta and the 2026-07-28 release candidate direction. That means:

  • Streamable HTTP is the primary transport.
  • /mcp is stateless HTTP in this sample.
  • The SDK version is pinned exactly because v2 is still a pre-release.
  • This is a template and learning sample, not a production MCP compatibility claim.

Auth Discovery

This sample does not implement OAuth or OpenID Connect discovery. Some MCP clients may probe .well-known URLs before calling /mcp, such as:

  • /.well-known/oauth-protected-resource/mcp
  • /mcp/.well-known/oauth-protected-resource
  • /.well-known/oauth-authorization-server/mcp
  • /.well-known/openid-configuration/mcp

Those requests can return 404 Not Found in this local sample. That is expected as long as JSON-RPC requests to /mcp return 200 OK or 202 Accepted.

To turn this into an authenticated HTTP MCP server, add:

  • OAuth 2.0 Protected Resource Metadata for the MCP resource server.
  • Authorization Server Metadata or a documented external authorization server.
  • WWW-Authenticate headers on 401 Unauthorized responses that point clients to the protected resource metadata.
  • Bearer token validation on every MCP HTTP request, including audience checks so tokens are scoped to this MCP server.
  • Tests for anonymous access, invalid tokens, valid tokens, metadata discovery, and token audience failures.

Layout

app/
  main.py              # FastAPI app and /mcp route wiring
  mcp_server.py        # MCP tools, resources, prompts
  schemas.py           # Pydantic request/response models
  config.py            # pydantic-settings config
  internal/
    catalog.py         # mock domain logic
  routers/
    health.py
    projects.py
  tests/

Run Locally

cd app
uv sync --python 3.14 --prerelease allow
uv run uvicorn main:app --reload --host 127.0.0.1 --port 8001

Open:

  • REST docs: http://127.0.0.1:8001/docs
  • MCP endpoint: http://127.0.0.1:8001/mcp

Checks

Run the public checks directly with uv:

cd app
uv run ruff check .
uv run ruff format --check .
uv run mypy .
uv run pytest
uv audit

uv audit is included as the modern dependency-health command to run against the lockfile. Keep it visible, but treat upstream advisory availability and the current uv release status as operational context.

Key Notes

  • Keep REST/MCP layers thin: validate transport input, call internal logic, return typed models.
  • Be cautious when you make MCP for irreversible or destructive actions.
  • Add auth, database, background work, and external clients as separate layers.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for FastAPI backend template with an MCP Streamable HTTP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-rest-sample)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools