A modular, scalable foundation for building AI agents with FastAPI, OpenAI, and MCP.
You can view the full documentation here with Mintlify.
- Hybrid tools (local Python + MCP) with OpenAI-compatible schemas.
- Streaming and non-streaming agent loop with tool calling.
- Optional persistence (Redis/Postgres) and auth (API key / JWT).
- Install deps
uv sync- Configure env
cp .env.example .env # set OPENAI_API_KEY, CHASSIS_API_KEY (optional)- Run the API
uv run uvicorn app.main:app --reloadAPI lives at http://localhost:8000 (see Mintlify for endpoints and tool setup).
- Add local tools in
app/services/local_tools.pywith@local_registry.register. - Add MCP servers in
mcp_config.json(stdio/SSE/streamable-http). - Restrict allowed tools per request via
allowed_tools.
uv run pytestAgent Chassis is a modular, asynchronous foundation for building AI agents with FastAPI, OpenAI, and MCP (Model Context Protocol). It serves as a robust "scaffolding" for agentic applications, handling the heavy lifting of infrastructure, protocol management, and tool execution so developers can focus on agent logic.
-
Agent Service (
app/services/agent_service.py): The central brain that orchestrates a multi-turn Plan-Act-Observe loop with streaming support and robust error handling. -
MCP Manager (
app/services/mcp_manager.py): Manages connections to Model Context Protocol servers via stdio or Server-Sent Events (SSE) protocols. -
Local Tool Registry (
app/services/local_tools.py): A decorator-based system for exposing local Python functions as tools to the agent. -
Tool Translator (
app/services/tool_translator.py): Universal adapter that converts MCP Tools and Python functions to OpenAI JSON Schema format. -
Security & Configuration (
app/core/): Manages API key authentication, settings via pydantic-settings, and environment configuration.
- Hybrid Tooling: Combine remote MCP tools with local Python functions seamlessly
- Streaming & Non-Streaming: Choose between real-time token-by-token feedback or blocking responses
- Session Persistence: Optional Redis + PostgreSQL storage for conversation history
- Authentication: Support for API key and JWT-based auth with Google OAuth
- OpenAI Compatible: Works with OpenAI API and compatible providers
- View the full documentation at agent-chassis.techlitnow.com
- Check out AGENTS.md for a more in-depth codebase walkthrough
- See CLAUDE.md for detailed context for AI assistants
- Explore the
/docsdirectory for comprehensive guides on configuration, tool development, and MCP integration