synapse-research
A deep-research MCP server exposing a single task-augmented tool that runs GPT-Researcher with Tavily search, Anthropic Claude, and OpenAI embeddings, streaming progress via MCP tasks and Upjack entity stream.
README
synapse-research
Deep-research MCP app. Exposes one task-augmented tool (start_research) that runs GPT-Researcher against Tavily (web search), Anthropic Claude (planner + writer LLM), and OpenAI (embeddings only), and streams progress back through both the MCP tasks protocol and the Upjack entity stream. Fully compliant with the MCP 2025-11-25 draft tasks utility via FastMCP 3.
View on mpak registry | Built by NimbleBrain
Quick Start
Install via mpak into your NimbleBrain workspace:
mpak install @nimblebraininc/synapse-research
Set the three required credentials in your host's shell (Bun auto-loads .env, or export directly):
export ANTHROPIC_API_KEY=sk-ant-...
export TAVILY_API_KEY=tvly-...
export OPENAI_API_KEY=sk-...
Run a research task from your agent chat:
"Research what's new with Model Context Protocol in 2026"
The agent fires start_research, the worker streams progress into the chat UI and into the Synapse sidebar dashboard, and you get back a markdown report in ~30s–3min.
Architecture
chat: "research X"
│
▼
NimbleBrain engine ──┐
│ tools/call (task-augmented)
▼
FastMCP server (this app)
│
├─► creates research_run entity (status=working)
├─► spawns worker (asyncio)
│ │
│ ├─► ctx.report_progress ──► notifications/tasks/status ──► engine
│ └─► app.update_entity ──► filesystem ──► Synapse UI live stream
│
└─► returns CreateTaskResult immediately
(engine polls tasks/get, retrieves via tasks/result when terminal)
Two independent channels update in lockstep:
- Engine channel — MCP task status notifications. The engine uses these to render progress in the chat UI and to stabilise polling cadence.
- UI channel — entity writes via Upjack. The Synapse sidebar app reads the entity stream to render a live dashboard of runs.
UI retry flow
The sidebar's "Retry with same query" button uses useCallToolAsTask("start_research") from the Synapse SDK (≥ 0.7.0). The task handle returns a taskId in under a second; the new research_run entity materialises shortly after (the worker creates it as its first action), and the UI navigates to the new detail page off the entity channel — not by waiting on the task's terminal result, which arrives minutes later. Second click on the button while "Starting…" routes through handle.cancel().
Legacy hosts (platform builds prior to the tasks-capability advertisement) cause callToolAsTask to throw. The UI catches that case and falls back to synapse.callTool fire-and-forget, so the feature keeps working with older deploys — only the starting-state indicator and the cancel handle degrade.
Configuration
Credentials (declared as user_config in manifest.json)
The host runtime prompts for these at install time or resolves them from a workspace-scoped store, then injects them into the bundle subprocess via mcp_config.env:
| Config key | Env var exposed | Purpose |
|---|---|---|
anthropic_api_key |
ANTHROPIC_API_KEY |
Claude LLM — planning + report writing |
tavily_api_key |
TAVILY_API_KEY |
Web search |
openai_api_key |
OPENAI_API_KEY |
Embeddings only (text-embedding-3-small) |
All three are required and marked sensitive: true.
Routing (hard-coded in mcp_config.env)
Not tenant-tunable in v1 — set directly in the manifest:
RETRIEVER=tavily
FAST_LLM=anthropic:claude-haiku-4-5
SMART_LLM=anthropic:claude-sonnet-4-6
STRATEGIC_LLM=anthropic:claude-sonnet-4-6
EMBEDDING=openai:text-embedding-3-small
To change an LLM or retriever, edit manifest.json and reinstall the bundle. Promoting any of these to user_config is a one-line change if per-workspace tuning is needed.
Cost and latency
- Typical run: 30s–3min.
- Typical cost: $0.15–$0.60/run on Sonnet 4.6 + Tavily advanced + OpenAI embeddings.
- Hard-cap: 5 minutes via
asyncio.wait_for. Longer runs are markedfailedwith a timeout error.
Data layout
One entity: research_run. Lives under:
$UPJACK_ROOT/apps/research/data/research_runs/{id}.json
Data-root resolution priority:
UPJACK_ROOTenv varMPAK_WORKSPACEenv var~/.synapse-research(fallback)
Each workspace spawns its own server process with its own root. There is no cross-workspace state inside the server.
Running locally
Install deps
uv sync
cd ui && npm install && npm run build && cd ..
Stdio (Claude Desktop, any MCP client)
uv run python -m mcp_research.server
HTTP (NimbleBrain platform)
uv run uvicorn mcp_research.server:app --port 8002
Tests (keyless — no API keys required)
uv run pytest tests/ -v
The spec-compliance suite (tests/test_spec_compliance.py) exercises every MUST from the MCP tasks draft: capability advertisement, execution.taskSupport gating, tasks/get|result|cancel|list, TTL behaviour, progress notifications, workspace isolation. The worker suite (tests/test_worker.py) covers happy path, cancel, failure, monotonic progress, and source streaming. All tests use a FakeGPTR monkeypatch so real providers are never called in CI.
Tool reference
| Tool | Task support | Description |
|---|---|---|
start_research |
optional |
The only custom tool. Runs the research worker end-to-end. |
get_research_run |
n/a | Auto-generated entity tool (read by id). |
list_research_runs |
n/a | Auto-generated entity tool. |
search_research_runs |
n/a | Auto-generated entity tool. |
delete_research_run |
n/a | Auto-generated entity tool (soft delete). |
Cancellation is handled at the MCP protocol level via tasks/cancel. The worker catches asyncio.CancelledError, flips the entity to cancelled, and re-raises so FastMCP transitions the task to its cancelled terminal state.
Contributing
See CLAUDE.md for the architecture walkthrough, commands, conventions, and build pipeline.
Quality gates (run before opening a PR):
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run ty check src/
uv run pytest tests/ -v
cd ui && npm ci && npm run build
CI enforces the same gates — see .github/workflows/ci.yml.
Ecosystem
- NimbleBrain — the agent platform this app runs on
- mpak — MCP bundle registry where releases are published
- Upjack — declarative AI-app framework (entity schemas, skills, hooks)
- Synapse SDK — React hooks powering the UI
- GPT-Researcher — Apache-2.0 research engine this app wraps
- Discord community
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。