abstract-backend-mcp
Provides FastAPI introspection tools such as listing routes, finding routes, and showing OpenAPI summary, with optional runtime import for route inspection.
Provides MongoDB operations including readonly inspection (list collections, sample documents, count documents, show indexes) and controlled writes (insert, update, delete) with permission controls and redaction.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@abstract-backend-mcprun all tests with pytest"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
abstract-backend-mcp
Reusable MCP server for Python backend development with FastAPI, MongoDB and Stackraise support.
Features
Health & diagnostics – ping, runtime config, project health checks
Test runner – pytest via Poetry (all, by file, keyword, node-id)
Quality tools – ruff check, ruff format, pyright, combined suite
FastAPI introspection – list routes, find routes, OpenAPI summary
MongoDB operations – readonly inspection + permission-controlled writes
Stackraise context – module detection, domain models, auth scopes, workflows, context snapshots
Bootstrap CLI – auto-generate config files for any Python backend
Related MCP server: FastAPI MCP Template
Requirements
Python >= 3.12
Poetry
Installation
# Clone and install
git clone <repo-url> abstract-backend-mcp
cd abstract-backend-mcp
poetry installQuick Start
# Bootstrap MCP config in your project
cd /path/to/your-project
poetry run abstract-mcp init
# Start MCP server (stdio transport)
poetry run abstract-mcp serve
# With a YAML config override
poetry run abstract-mcp serve --config mcp.project.yamlUsage: How to Connect the MCP to Your Project
There are three ways to use this MCP server, from lightest to most integrated:
Option A: Reference from your MCP client (recommended, zero coupling)
The MCP lives in its own repo. Your project only needs a client config file (e.g. opencode.jsonc, VS Code MCP settings, etc.) pointing to it:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"abstract-mcp": {
"type": "local",
"command": [
"poetry",
"-C",
"/path/to/coding-mcp",
"run",
"abstract-mcp",
"serve",
"--config",
"/path/to/your-project/mcp.project.yaml"
],
"enabled": true,
"environment": {
"PROJECT_NAME": "my-app",
"PROJECT_ROOT": "/path/to/your-project",
"FASTAPI_APP_PATH": "src.main:app"
}
}
}
}Pros: no dependency added to your project, one MCP repo serves multiple projects. Cons: every dev needs the MCP repo cloned locally at a known path.
Option B: Install as a local dev dependency
From your project directory:
poetry add --group dev /path/to/coding-mcpThen you can run the CLI directly inside your project:
poetry run abstract-mcp init # generate config files
poetry run abstract-mcp serve # start MCP serverAnd point your client config to the project itself:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"abstract-mcp": {
"type": "local",
"command": ["poetry", "run", "abstract-mcp", "serve"],
"enabled": true
}
}
}Pros: self-contained, any dev can run poetry install and it works.
Cons: adds a dev dependency; linked to a local path (or needs a registry).
Option C: Publish to a private registry (teams)
cd /path/to/coding-mcp
poetry build
poetry publish --repository your-private-registryThen in any project:
poetry add --group dev abstract-backend-mcpPros: versioned, no local path coupling. Cons: requires a package registry.
Multiple projects simultaneously
Each client session spawns its own MCP process (stdio transport = 1 process per connection). You can run multiple projects at the same time without conflicts — each has its own config and its own process.
Typical workflow
1. Clone coding-mcp once on your machine
2. In your target project:
a. Create a mcp.project.yaml with project-specific settings
b. Point your MCP client to the server (option A, B, or C)
3. Start your client (OpenCode, VS Code, Copilot CLI, etc.)
4. The MCP exposes all configured tools to the agentConfiguration
Settings are loaded from (in order of priority):
Environment variables
.envfileYAML config file (via
--configorCONFIG_FILEenv var)Built-in defaults
Key settings
Variable | Default | Description |
|
| Project identifier |
|
| Current environment |
|
| Python import path of the FastAPI app |
|
| MongoDB connection string |
|
| Maximum number of sampled documents returned by MongoDB tools |
|
| Maximum total bytes returned by |
|
| Max characters preserved per string field in sampled documents |
|
| Enable FastAPI tools |
|
| Allow importing FastAPI runtime app for route/OpenAPI inspection |
|
| Enable MongoDB tools |
|
| Enable Stackraise tools |
|
| Enable deep module/symbol indexing |
|
| Allow MongoDB writes |
|
| Require explicit |
|
| Collection allowlist (empty = all) |
|
| Extraction mode: |
|
| Allow live runtime imports during context extraction |
|
| Optional glob roots for Stackraise packages |
|
| Max lines returned by source-oriented tools |
|
| Global cap for deep snapshot inventories |
|
| Max items returned by paginated Stackraise tools |
|
| Max accepted length for |
|
| Search timeout budget in milliseconds |
|
| Max total scanned lines for code search |
|
| Cache TTL for Stackraise context provider |
|
| Max in-memory context cache entries |
|
| TTL for project fingerprint reuse before rescanning files |
|
| Redact secrets in all output |
|
| Path to project instructions file |
Cache profile recommendations
High precision profile (always reflect file changes quickly):
STACKRAISE_CONTEXT_FINGERPRINT_TTL_SECONDS=0STACKRAISE_CONTEXT_CACHE_TTL_SECONDS=0
Balanced profile (default, better performance):
STACKRAISE_CONTEXT_FINGERPRINT_TTL_SECONDS=1STACKRAISE_CONTEXT_CACHE_TTL_SECONDS=30
Use the high precision profile when actively editing many modules and you need the most up-to-date snapshot on every request.
Project Instructions (PROJECT.md)
Each project can define a PROJECT.md file that the MCP reads at startup and passes as context to the agent. This replaces the generic default instructions with project-specific goals, architecture notes, and conventions.
Format
The file uses YAML frontmatter (optional) + markdown body:
---
name: my-app
description: Document management API with electronic signatures
stack:
- FastAPI
- MongoDB
- Stackraise
conventions:
- Use Pydantic for all validation
- Tests required for every endpoint
- Spanish comments in domain code
---
## Objetivo
REST API for document management with workflow automation...
## Arquitectura
- backend/src/demo/ contains the main app
- Domain models in domain/
- Services in service/
## Notas para el agente
- Do not modify auth fixtures without confirmation
- Integration tests require MongoDB running locallyHow it works
On startup, the MCP reads
PROJECT.md(or the file configured inPROJECT_INSTRUCTIONS_FILE) from the project rootThe frontmatter metadata (name, stack, conventions, description) is formatted and prepended
The markdown body is included as the main instructions
The combined text is passed to the MCP server as
instructions, which the agent receives as context
Behavior
Scenario | Result |
| Full instructions with metadata |
| Entire file used as instructions |
| Generic default instructions |
Invalid YAML frontmatter | Warning logged, body used as instructions |
Generation
Running abstract-mcp init generates a PROJECT.md template with detected stack info and placeholder sections.
Runtime access
The tool show_project_instructions lets the agent re-read the parsed PROJECT.md at any time during a session.
Tools
Health
ping– server alive checkshow_runtime_config– sanitized settingslist_enabled_tools– active tool groupscheck_project_health– project structure detection
Tests & Quality
run_tests_all,run_tests_file,run_tests_keyword,run_tests_nodeidrun_ruff_check,run_ruff_format_check,run_pyright,run_quality_suite
FastAPI
list_routes,find_route,show_openapi_summary
When ALLOW_FASTAPI_RUNTIME_IMPORTS=false, FastAPI introspection tools return a blocked error envelope.
MongoDB
Readonly:
list_collections,sample_documents,count_documents,show_indexesWrites:
insert_one_controlled,update_one_controlled,delete_one_controlled
MongoDB sample responses are bounded by MONGODB_SAMPLE_MAX_DOCUMENTS and respect
REDACT_SENSITIVE_FIELDS for textual/key-based redaction.
Additionally, payload size is bounded by MONGODB_SAMPLE_MAX_BYTES and large string
fields are truncated according to MONGODB_SAMPLE_MAX_FIELD_CHARS.
Stackraise
detect_stackraise,show_stackraise_modulesshow_stackraise_db_metadata,show_stackraise_auth_scopeslist_stackraise_crud_resources,list_stackraise_workflowslist_stackraise_module_tree,list_stackraise_modulesshow_stackraise_module_symbols,show_stackraise_symbol_sourceread_stackraise_module_chunk,search_stackraise_code(use_regex=falseby default)build_stackraise_context_snapshot– full context with schema:project,stackraise.modules,stackraise.domain,stackraise.apistackraise.auth,stackraise.workflows,stackraise.frontend_contractssecurity(redacted, warnings),extraction(mode, fallback, warnings)
Recommended Stackraise flow
Use navigation in this order to keep responses compact and deterministic:
build_stackraise_context_snapshot(mode="hybrid")list_stackraise_module_tree()show_stackraise_module_symbols(module="stackraise.some_module")show_stackraise_symbol_source(symbol_id="...")orread_stackraise_module_chunk(...)
For large codebases, prefer bounded tree navigation with
list_stackraise_module_tree(parent_module="stackraise", depth=0, limit=50).
By default, list_stackraise_module_tree uses depth=0 to avoid returning deep subtrees.
This workflow follows snapshot -> tree -> symbols -> source and avoids large payloads.
Write Operation Policy
All MongoDB writes are gated by:
ALLOW_WRITE_OPERATIONSmust betrueENVIRONMENTmust not beproduction/prodCollection must be in
ALLOWED_WRITE_COLLECTIONS(if non-empty)confirmed=Truemust be passed explicitly (whenREQUIRE_WRITE_CONFIRMATION=true)
Context Extraction Modes
Mode | Behavior |
| AST analysis of source files, no imports |
| Live introspection of imported modules (requires |
| Runtime with automatic fallback to static (runtime disabled by policy by default) |
Secret Redaction
When REDACT_SENSITIVE_FIELDS=true (default), context output is redacted in two layers:
key-based redaction (
password,secret,token,api_key, etc.)textual redaction for symbol/source content (docstrings, literals, bearer/query tokens)
Sensitive values are replaced with ***REDACTED***.
OpenCode Integration
After running abstract-mcp init, use the generated opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"abstract-mcp": {
"type": "local",
"command": ["poetry", "run", "abstract-mcp", "serve"],
"enabled": true
}
}
}The generated opencode.jsonc also includes an agent block with predefined prompts:
audit – review, quality and security assessment
build – implementation from execution plan
fix – remediation based on audit findings
doc – documentation engineering (Markdown-only edits)
plan – planning and decomposition before implementation
AGENTS.md remains a concise operational role reference and is generated alongside
opencode.jsonc.
Limitations (v1)
No HTTP/SSE transport (stdio only)
Dependency tracing is static and best-effort (import graph only)
Stackraise introspection is best-effort and defensive
No advanced RPA analysis beyond detection
MongoDB adapter uses pymongo (no async motor)
Development
poetry install
poetry run pytest -v
poetry run ruff check .This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/marmillas/stackraise-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server