fbbp-mcp-rag-server
Provides tools for searching PubMed and retrieving compact article summaries, enabling access to biomedical literature.
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., "@fbbp-mcp-rag-serversearch for latest neuropathology findings"
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.
FBBP MCP RAG Server
An MCP-compatible, provenance-aware retrieval service connecting coding agents and AI IDEs to the FBBP knowledge stack.
Status: Runnable service and formal snapshot contract | Public release: 2026-06-10
Start here | Resource |
Primary documentation | |
Reproducibility / implementation | |
Verified outcomes |

What This Repo Does
Exposes
ragkbretrieval and ingest operations as MCP toolsLets DeerFlow, Codex, Cursor, or Claude Code call your private knowledge base through MCP
Reuses your existing
llm-rag-knowledge-baseinstead of creating a second RAG stack
Related MCP server: Hoard
Formal Snapshot Contract
The real FBBP formal runtime now reads its checked-in JSONL snapshot from this repo instead of reading runtime data files directly out of llm-rag-knowledge-base.
active snapshot root:
formal_snapshots/fbbp_private_v2026_04/runtime descriptor:
configs/datasets/fbbp_private_v2026_04.jsonsnapshot manifest:
formal_snapshots/fbbp_private_v2026_04/MANIFEST.json
Use this command when you explicitly want to refresh the checked-in snapshot from the canonical upstream RAG-ready exports:
scripts\sync_formal_snapshot.ps1Preview the sync plan without copying files:
scripts\sync_formal_snapshot.ps1 -PreviewOnlyscripts\rebuild_fbbp_formal_db.ps1 now rebuilds from the repo-local formal snapshot. It no longer depends on reading JSONL files out of the sibling RAG repo at runtime.
Tools Exposed
Runtime and Contract
server_status- basic runtime and shared RAG configuration checkshealth_status- runtime, database, and public scientific lookup diagnosticstool_contract_version- return the current formal MCP tool contract version
Private Knowledge Access
list_sources- list indexed sources and chunk countslist_record_types- aggregate available record types in the shared knowledge baseget_source_summary- summarize one source across record types and chunk countsget_document_chunk- fetch a specific indexed chunk bysource + chunk_idsearch_knowledge- semantic retrieval with optional structured filters and answer synthesisexplain_search- return normalized search parameters plus retrieval summarypreview_ingest- inspect a candidate ingest path without mutating the databaseingest_sources- ingest local files into the shared FBBP vector store
Public Scientific Lookups
search_pubmed- search PubMed and return compact article summariesget_uniprot_entry- fetch a compact UniProtKB entry by accessionget_pdb_entry- fetch a compact RCSB PDB entry by identifier
Design Choice
This repo intentionally stays thin:
ragkbremains the knowledge enginethis server only provides MCP-compatible tool access
DeerFlow and other agents consume the tools without duplicating ingestion or retrieval logic
external scientific lookups stay lightweight and call public REST APIs directly
Formal Search Execution Model
search_knowledge on the MCP HTTP server now uses a single formal execution path on this machine:
Codex / MCP client
-> fbbp-mcp-rag-server search_knowledge
-> DeerFlow formal Python gateway (/api/fbbp/formal-search on :8001)
-> in-process fbbp_mcp_server.service.search_knowledge
-> ragkb / PostgreSQLThis removes the old Next.js API + script hop from the formal path and keeps the stable execution surface in one always-on backend process.
Environment knobs:
FBBP_FORMAL_QUERY_GATEWAY_URLFBBP_FORMAL_QUERY_GATEWAY_TIMEOUT_SECONDSFBBP_FORMAL_DEFAULT_ANSWER_MODELegacy lowercasefbtp-prefixed environment aliases are still accepted internally for backward compatibility, but all public deployment examples should use theFBBP_*names above.
Expected diagnostics for MCP search_knowledge:
query_transport = formal_http_gatewaygateway_urlgateway_backend_transport
The live formal path now defaults to answer_mode = formal whenever a grounded answer is requested. That mode uses multi-query fusion over the real FBBP database and emits deterministic structured output:
summaryclaimskey_findingsknown_unknownsevidence_rowsevidence_tablesource_registry_used
Formal Gateway Status
The DeerFlow backend now exposes a production status surface for the live FBBP stack:
GET http://127.0.0.1:8001/api/fbbp/statusPOST http://127.0.0.1:8001/api/fbbp/formal-searchPOST http://127.0.0.1:8001/api/fbbp/canary
The status payload includes:
startup
warmuptiming for embeddings / routing / reranker / LLMstartup
canaryresult against the real FBBP databaseMCP HTTP reachability
the active
dataset_version,runtime_profile,formal_db_mode,db_identity, andsource_registry_version
Formal Contract
The server is moving toward a formal, provenance-aware response contract for every tool. Each tool response follows the same top-level shape:
{
"ok": true,
"tool": "search_knowledge",
"contract_version": "1.0",
"request": {},
"result": {},
"provenance": {},
"diagnostics": {},
"error": null
}See docs/formal_tool_contract.md for the detailed contract and the intended DeerFlow usage order.
Formal runtime metadata can also be supplied through:
FBBP_FORMAL_DATASET_VERSIONFBBP_FORMAL_RUNTIME_PROFILELegacy lowercasefbtp-prefixed aliases are still accepted internally for older local scripts.
Checked-in descriptor examples live under:
configs/datasets/configs/runtime/formal_snapshots/
Architecture
flowchart LR
IDE[Codex / Cursor / Claude Code] --> MCP[FBBP MCP RAG Server]
Deer[DeerFlow Overlay] --> MCP
MCP --> Gateway[DeerFlow formal HTTP gateway]
Gateway --> RAG[ragkb service layer]
RAG --> PG[Postgres + pgvector]Quick Start
1) Create a dedicated environment
cd fbbp-mcp-rag-server
powershell -ExecutionPolicy Bypass -File scripts/bootstrap_local_env.ps1This creates .venv and installs both editable packages:
../llm-rag-knowledge-base./fbbp-mcp-rag-serveras the portfolio package name (./fbbp-mcp-rag-serverremains the current repo path)
2) Configure database / model environment
You can reuse the same environment variables as llm-rag-knowledge-base:
PGHOSTPGPORTPGDATABASEPGUSERPGPASSWORDPGTABLEEMBEDDING_PROVIDERANSWER_MODE
Optional:
RAGKB_SRC_PATH- override the siblingragkbsource pathFBBP_MCP_DEFAULT_TOP_K- default retrieval sizeFBBP_MCP_DEFAULT_ANSWER_MODE- default answer mode used bysearch_knowledgeLegacy lowercase
fbtp-prefixed defaults are still accepted internally for compatibility with older local scripts.
3) Run the server
stdio mode
python server.pystreamable HTTP mode
python server.py --transport streamable-http --host 127.0.0.1 --port 8000The root server.py also checks the repo-local .venv site-packages, so it still works after workspace moves where the old venv launcher path becomes stale.
Stable Windows Local Workflow
When the repo-local .venv\Scripts\python.exe launcher becomes stale after moving the workspace between machines or drive letters, the recommended Windows local path is to use the system python with -S and let the repo bootstrap its own site-packages.
Localhost 5432 Self-Heal
The stable local smoke path now treats PostgreSQL readiness as a real query check instead of only checking whether localhost:5432 has an open TCP listener.
On this machine, a stale Windows portproxy entry on 127.0.0.1:5432 could make the port look open while also blocking the WSL PostgreSQL cluster from binding the same port. The one-command smoke path now fixes that automatically:
removes legacy local
portproxyentries on127.0.0.1:5432starts the WSL PostgreSQL cluster if needed
ensures the formal
ragkbdatabase andvectorextension existwaits until
SELECT 1succeeds onlocalhost:5432
Manual probe command:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\ensure_local_formal_pg_ready.ps1One-Command Rerun
If you want a fresh local smoke run and automatic teardown in one command:
scripts\run_local_smoke_once.cmdWhat it does:
prefers WSL PostgreSQL by default
only uses Windows PostgreSQL when you explicitly opt in
self-heals stale
localhost:5432portproxy state before starting WSL PostgreSQLtreats readiness as a real SQL query instead of a port-open check
launches the MCP HTTP server
runs the local smoke checks
emits one structured JSON payload with
ensure_pgandsmokestops the temporary PostgreSQL / MCP processes before exit
If you only want to inspect the derived plan without starting anything:
scripts\run_local_smoke_once.cmd -PlanOnlyIf you explicitly want to try Windows PostgreSQL first:
scripts\run_local_smoke_once.cmd -PreferWindowsPostgres1) Start a fresh local PostgreSQL cluster in one terminal
scripts\start_fresh_postgres_foreground.cmdThis initializes a clean cluster under the workspace and starts PostgreSQL in the foreground on 127.0.0.1:5434. Keep that terminal open.
2) Prepare the database in a second terminal
scripts\prepare_fresh_postgres_database.cmdThis waits for PostgreSQL to become ready, creates the ragkb database if needed, and enables the vector extension.
3) Start the MCP HTTP server in a third terminal
scripts\start_http_server.cmdIf you call the PowerShell script directly, use -ListenHost instead of -Host:
scripts\start_http_server.ps1 -ListenHost 127.0.0.1 -Port 8000The MCP endpoint will be:
http://127.0.0.1:8000/mcp4) Run a local smoke test
scripts\smoke_local_stack.cmdThis performs:
health_statusingest_sourceson a small checked-in datasetlist_sourcessearch_knowledgeget_document_chunk
Formal Acceptance
Run the MCP formal acceptance suite with:
scripts\run_formal_acceptance.ps1This validates the handshake metadata and provenance fields required by the DeerFlow formal run layer.
Live 4-Client Acceptance
Run the real MCP client acceptance sweep with:
python scripts\run_live_client_acceptance.pyThis performs real initialize, list_tools, and tool-call checks across:
Codex (
streamable-http)Claude Code (
streamable-http)Cursor (
streamable-http)DeerFlow (
stdio)
Generated artifacts:
reports/final_release/latest/live_client_acceptance.jsonreports/final_release/latest/live_client_acceptance.md
AI IDE Integration
Codex CLI
Example file:
examples/clients/codex.config.tomlCopy the
mcp_servers.fbbp-ragblock into your Codex CLI configuration file and adjust repository-local paths for your checkout.
Cursor
Example file:
examples/clients/cursor.mcp.jsonMerge the
mcpServers.fbbp-ragblock into your Cursor MCP config
Claude Code
Example file:
examples/clients/claude-code.mcp.jsonUse it as the project-level
.mcp.jsonshape or merge themcpServers.fbbp-ragblock into your existing config
CI Release Gate
The repo now also ships a dedicated MCP release workflow:
.github/workflows/fbbp-mcp-release-gate.yml
It runs:
package install
python scripts/run_live_client_acceptance.pypython scripts/final_release_check.py
DeerFlow Integration
Use the example config in examples/extensions_config.deerflow.json and copy it into DeerFlow's extensions_config.json.
Recommended command for DeerFlow:
python E:/项目/fbbp-mcp-rag-server/server.pyScientific Connector Coverage
The same MCP server now exposes three thin external scientific lookup tools:
search_pubmedget_uniprot_entryget_pdb_entry
That lets DeerFlow combine:
private FBBP retrieval through
search_knowledgepublic literature summaries from PubMed
public protein/structure metadata from UniProt and RCSB PDB
Scientific Lookup Reliability
The lookup layer now includes:
in-process response caching
retry/backoff for transient upstream errors
a minimum interval throttle between repeated calls
The private search_knowledge tool also now includes an in-process request cache so repeated identical demo queries do not hit the shared retrieval backend every time.
The private search_knowledge tool also now includes an in-process request cache so repeated identical formal queries do not hit the shared retrieval backend every time.
Environment knobs:
FBBP_SCI_CACHE_TTL_SECONDSFBBP_SCI_RETRY_ATTEMPTSFBBP_SCI_RETRY_BACKOFF_SECONDSFBBP_SCI_MIN_INTERVAL_SECONDSFBBP_MCP_SEARCH_CACHE_TTL_SECONDSLegacy lowercase
fbtp-prefixed scientific lookup and cache keys are still accepted internally for older local scripts.
Formal Materials
Canonical portfolio summary:
FINAL_RESULT_SUMMARY.md
Screenshots
Frontend showcase: FBBP formal console
LangGraph docs:
docs/screenshots/langgraph_docs.pngGateway docs:
docs/screenshots/gateway_docs.png

Acceptance Artifacts
If you want the current end-to-end proof chain, check:
Recommended Setup with This Workspace
Keep the clean upstream RAG engine in
../llm-rag-knowledge-baseKeep DeerFlow upstream in
../upstream-deerflowPoint DeerFlow to this MCP server via HTTP or stdio
Let DeerFlow use this server as the private knowledge source for FBBP tasks
Current Integration Status
MCP tool surface is complete and stable for local development
DeerFlow integration is validated end-to-end
Formal runtime metadata and acceptance coverage are now part of the service layer
Codex / Cursor / Claude Code configuration examples are included in
examples/clients/README now includes screenshot references and formal acceptance artifact pointers
live 4-client acceptance artifacts now sit beside the final release summary
external PubMed / UniProt / PDB lookups are available through the same MCP endpoint
Roadmap
Add health probes for the shared
ragkbtable state before each tool call.Add optional cache invalidation hooks for repeated
search_knowledgerequests after rebuilds.Add a sample smoke-test script that validates stdio and HTTP transport in one run.
Add richer source filtering presets for structure-only and methodology-only queries.
Notes
This project is intentionally Python-first to stay aligned with your current
ragkbcodebase.It references MCP design ideas, but does not inherit a TypeScript MCP server stack.
For the smoothest DeerFlow integration, use the dedicated virtual environment created by
scripts/bootstrap_local_env.ps1.
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/changyufei222/fbbp-mcp-rag-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server