mcp-fastapi-starter
Provides read-only SQL query access to a configured SQLite database, enforcing single SELECT/WITH statements, read-only mode, and query-only PRAGMA.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-fastapi-starter
A production-hardened Model Context Protocol (MCP 2.x) + FastAPI server scaffold built for real-world AI agent integrations—shipping with fail-closed Bearer authentication, per-tool sliding-window rate limiting, a three-state upstream circuit breaker, SSRF IP/DNS guards, read-only SQL validation, and structured secret-redacted audit logging.

Key Engineering Guarantees
Control Layer | Implementation | Default Behavior |
Dual Transport | Official |
|
Fail-Closed Auth | Constant-time | Refuses to start if |
SSRF Protection |
| Optional |
Read-Only SQL Gate |
| Single |
Resilience |
| Trips after |
Audit & Observability |
| Never logs tokens, passwords, or cookies |
Related MCP server: mcp-gateway
Quickstart
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -e ".[dev]"Run Offline Test Suite
pytest -vRun Streamable HTTP Server (FastAPI + MCP)
cp .env.example .env
export MCP_API_TOKEN="your-strong-random-token"
python -m mcp_starter.server --transport http --host 127.0.0.1 --port 8000Endpoints:
GET /health— unauthenticated health probe (status,circuit_breaker)GET /api/metrics— authenticated audit & latency summaryPOST /mcp/— authenticated MCP Streamable HTTP JSON-RPC endpoint
Run stdio Mode (Claude Desktop / Cursor)
{
"mcpServers": {
"mcp-fastapi-starter": {
"command": "/path/to/mcp-fastapi-starter/.venv/bin/python",
"args": ["-m", "mcp_starter.server", "--transport", "stdio"],
"env": {
"MCP_SQLITE_PATH": "/path/to/your/readonly.db",
"MCP_ALLOWED_HOSTS": "api.github.com"
}
}
}
}Project Layout
mcp-fastapi-starter/
├── docs/
│ └── architecture.png
├── src/mcp_starter/
│ ├── __init__.py
│ ├── audit.py # Redacted JSON audit ring buffer & logger
│ ├── config.py # Fail-closed env config
│ ├── guards.py # SSRF, read-only SQL, rate limiter, circuit breaker
│ └── server.py # FastAPI + MCPServer tools & ASGI mount
├── tests/
│ ├── test_guards.py # Bidirectional security/resilience unit tests
│ └── test_server.py # End-to-end Streamable HTTP MCP + Auth + SQLite tests
├── .env.example
├── LICENSE
└── pyproject.tomlTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Guarded webhook inbox and SSRF-safe HTTP/gRPC action gateway for AI agents via remote MCP.
Zero-trust gateway for AI agents: score tool calls, verify agent cards, enforce policy, audit.
AgentGuard — 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to securely discover, execute, and observe tools with role-based access control and audit logging. Serves tools over MCP stdio and HTTP for integration with Claude Desktop, Cursor, and other clients.1-
- AlicenseNot gradedqualityBmaintenanceEnables secure exposure of internal tools to LLM clients with API-key authentication, tenant isolation, per-tool guardrails, PII scrubbing, rate limiting, audit logging, and telemetry over stdio and HTTP/SSE.MIT
- AlicenseAqualityCmaintenanceEnables developers to expose product operations as model-callable tools over stdio or Streamable HTTP with bearer-token auth, per-client rate limits, host allow-listing, structured call logging, and a swappable backend for secure, testable deployments.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to access multiple stdio or Streamable HTTP MCP servers through one authenticated endpoint, enforcing OAuth bearer validation, per-client tool RBAC, rate limits, schema validation, audit logging, and tool-definition pinning.MIT