FastAPI Agent Blueprint logo

FastAPI Agent Blueprint

Community
Mr-DooSun

FastAPI backend blueprint for AI agent apps: DDD, SQLAlchemy, Taskiq, admin UI, RAG infra, and Claude/Codex collaboration harness.

PublisherMr-DooSun
Repositoryfastapi-agent-blueprint
LanguagePython
Forks
10
Stars
27
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    FastAPI Agent Blueprint exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    27 stars and 10 forks from the linked repository.

Backend foundationAI collaboration harness
Domain logic shared by HTTP APIs, background tasks, and an admin UI. Optional AI and infrastructure adapters let you start locally and add services as needed.Repository rules, task-specific skills, hooks, and review procedures guide changes to that backend across Claude Code, Codex, and Antigravity.
Run it locally · See the architectureFollow an API change · Read the shared workflow

Why this blueprint

Use it when you need multiple business domains, API + worker + admin surfaces, or a shared development workflow for teammates using AI coding tools. The backend and harness are designed together: the harness references this repo's layering, contracts, and verification commands.

Budget time to learn the domain layout, dependency-injector containers, and plan/review workflow. A small single-purpose API may not need that structure; a project needing a bundled customer frontend needs a different starting point. The harness is repository-specific, not a standalone drop-in package.

You can develop without AI tools using the manual domain tutorial. For incremental adoption and trade-offs, see the adoption guide and selection guide.

Quickstart

Prerequisites: Python >=3.12.9, uv, Git, and make. The demos also use curl and python3 on your PATH. No Docker, PostgreSQL, cloud credentials, or AI coding tool required.

Terminal 1 — start the backend:

bash
git clone https://github.com/Mr-DooSun/fastapi-agent-blueprint.git
cd fastapi-agent-blueprint
make quickstart

This installs the quickstart dependencies, creates a SQLite database, and keeps the server running on port 8001. Use a fresh checkout for evaluation: quickstart syncs the admin extra and can remove other installed extras. For development dependencies and commit hooks, use make setup when moving to the development setup.

Terminal 2 — from the same repository directory:

bash
make demo       # JWT auth, admin-realm login, user CRUD, refresh and logout
make demo-rag   # document upload, retrieval and an answer with citations

Keep terminal 1 running. Both demos check their API responses and report failure if a request does not succeed. The default RAG demo uses a keyword-based stub embedder and a templated stub answer agent; it demonstrates the pipeline without calling an external model.

These defaults are for local evaluation. Follow the development and deployment guides before using real data or exposing the service.

Backend demo: authentication and user CRUD

Backend foundation

CapabilityWhat it provides
Domain structureRouter → Service → Repository, with an optional UseCase for orchestration; automatic domain registration and reusable CRUD base classes.
API, worker, adminFastAPI endpoints, Taskiq background tasks, and NiceGUI admin pages consuming domain services.
Optional infrastructureSQL databases, DynamoDB, object storage, vector storage, and AI providers behind adapters and configuration. Start with SQLite + InMemory.
OperationsJWT/RBAC, structured logging, opt-in OpenTelemetry, AI usage accounting, and error notifications.

Worked example: document QA

The docs domain composes document upload, chunking, embedding, retrieval, and answers with citations. Its shared RAG pipeline can be reused by other domains (ADR 040).

For real model calls, install the pydantic-ai extra, configure EMBEDDING_PROVIDER + EMBEDDING_MODEL and LLM_PROVIDER + LLM_MODEL, and supply the selected providers' credentials. See the configuration reference for optional extras and settings; the RAG walkthrough shows the flow.

HTTP, worker, and admin interfaces are implemented. The MCP server interface is planned, not part of the runnable backend today.

AI collaboration harness

The harness helps contributors work within the same backend conventions:

CapabilityWhat it provides
Shared rulesAGENTS.md and shared references define architecture, contracts, security constraints, and the development workflow.
Task-specific skillsGuides for domains, APIs, worker tasks, admin pages, migrations, testing, review, and documentation sync.
Workflow boundariesPlanning and execution are separate steps. Scope changes, missing verification, and completion checks have explicit handling.
Checks and reviewCommit/CI checks inspect deterministic rules; reviews assess behavior, architectural fit, and documentation drift.

Worked example: add an API to an existing domain

For a request such as “add a filtered list endpoint to the order domain,” the workflow is:

StepContributor and agent actions
Frame and planClarify the contract and affected layers with /plan-feature (Claude) or $plan-feature (Codex). Review the resulting execution packet.
Start executionThe contributor explicitly invokes /execute-plan or $execute-plan with that packet. The executor routes API implementation through the add-api skill.
Implement and verifyReuse the existing layer patterns, add relevant tests, and run the packet's verification commands. Surface unplanned capability gaps before expanding the work.
Review and syncReview the diff; reconcile affected documentation with sync-guidelines when needed. Record verification and any unresolved items before PR completion.

This is an illustrative workflow, not a command that runs every step automatically. Human decisions remain part of the process.

What is enforced? Configured pre-commit/CI checks block detected violations such as prohibited imports, broken documentation links, or shared-file language policy failures. Workflow reminders are advisory in many cases. For example, the plan-to-execution gate blocks matching source edits in Claude, while Codex receives a Stop-time advisory. Tool adapters share policy but do not provide identical enforcement. See the operating model for current coverage and exceptions.

Domain scaffolding is another supported task:

Domain scaffolding through the new-domain skill

Set up Claude Code or Codex · Antigravity harness · Shared rules · Manual development path

Architecture at a glance

Every domain separates Interface, Domain, Infrastructure, and optional Application code. Runtime CRUD follows Router → Service → Repository; dependency arrows below describe imports, not request execution order.

Request schemas can pass directly to services when fields match. Model-to-DTO conversion belongs in repositories. Detailed write/read flows and storage variants are in the architecture guide (SVG versions).

Learn more

Roadmap

See the full roadmap and issue tracker.

Contributing

See CONTRIBUTING.md for setup and the PR workflow. The examples and good first issues are entry points for new contributors.

License

MIT — free for commercial use, modification, and distribution.


Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "mr-doosun-fastapi-agent-blueprint": {
      "command": "",
      "args": []
    }
  }
}

Use FastAPI Agent Blueprint MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once FastAPI Agent Blueprint is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add FastAPI Agent Blueprint as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the FastAPI Agent Blueprint MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mr-doosun-fastapi-agent-blueprint": {
      "command": "npx",
      "args": [
        "-y",
        "fastapi-agent-blueprint"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the FastAPI Agent Blueprint MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the FastAPI Agent Blueprint MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use FastAPI Agent Blueprint to help me with this task?
FastAPI Agent Blueprint
Sure. I read it.
Here is what I found using FastAPI Agent Blueprint.

Frequently asked questions

What is the FastAPI Agent Blueprint MCP server used for?

FastAPI Agent Blueprint is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use FastAPI Agent Blueprint MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use FastAPI Agent Blueprint with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use FastAPI Agent Blueprint MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With FastAPI Agent Blueprint connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect FastAPI Agent Blueprint MCP to TypingMind?

FastAPI Agent Blueprint runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does FastAPI Agent Blueprint MCP provide in TypingMind?

FastAPI Agent Blueprint exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use FastAPI Agent Blueprint MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If FastAPI Agent Blueprint requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇