{"id":49101474,"url":"https://github.com/nimblebraininc/synapse-research","last_synced_at":"2026-05-09T21:03:38.310Z","repository":{"id":352733757,"uuid":"1216330531","full_name":"NimbleBrainInc/synapse-research","owner":"NimbleBrainInc","description":"Deep-research Synapse app — task-augmented MCP tool powered by GPT-Researcher, Tavily, and Anthropic Claude. Live progress streaming via the MCP 2025-11-25 draft tasks utility.","archived":false,"fork":false,"pushed_at":"2026-04-20T22:04:27.000Z","size":309,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T23:30:53.272Z","etag":null,"topics":["deep-research","gpt-researcher","mcp","mcp-server","nimblebrain","research","synapse","upjack"],"latest_commit_sha":null,"homepage":"https://mpak.dev/packages/@nimblebraininc/synapse-research","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NimbleBrainInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T19:52:41.000Z","updated_at":"2026-04-20T22:04:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NimbleBrainInc/synapse-research","commit_stats":null,"previous_names":["nimblebraininc/synapse-research"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NimbleBrainInc/synapse-research","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleBrainInc%2Fsynapse-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleBrainInc%2Fsynapse-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleBrainInc%2Fsynapse-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleBrainInc%2Fsynapse-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NimbleBrainInc","download_url":"https://codeload.github.com/NimbleBrainInc/synapse-research/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleBrainInc%2Fsynapse-research/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32071013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-research","gpt-researcher","mcp","mcp-server","nimblebrain","research","synapse","upjack"],"created_at":"2026-04-21T00:00:28.217Z","updated_at":"2026-05-09T21:03:38.292Z","avatar_url":"https://github.com/NimbleBrainInc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# synapse-research\n\n[![mpak](https://img.shields.io/badge/mpak-registry-blue)](https://mpak.dev/packages/@nimblebraininc/synapse-research?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)\n[![NimbleBrain](https://img.shields.io/badge/NimbleBrain-nimblebrain.ai-purple)](https://nimblebrain.ai?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)\n[![Discord](https://img.shields.io/badge/Discord-community-5865F2)](https://nimblebrain.ai/discord?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nDeep-research MCP app. Exposes one task-augmented tool (`start_research`) that runs [GPT-Researcher](https://github.com/assafelovic/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.\n\n**[View on mpak registry](https://mpak.dev/packages/@nimblebraininc/synapse-research?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)** | **Built by [NimbleBrain](https://nimblebrain.ai?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)**\n\n## Quick Start\n\nInstall via [mpak](https://mpak.dev) into your NimbleBrain workspace:\n\n```bash\nmpak install @nimblebraininc/synapse-research\n```\n\nSet the three required credentials in your host's shell (Bun auto-loads `.env`, or export directly):\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\nexport TAVILY_API_KEY=tvly-...\nexport OPENAI_API_KEY=sk-...\n```\n\nRun a research task from your agent chat:\n\n\u003e \"Research what's new with Model Context Protocol in 2026\"\n\nThe 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.\n\n## Architecture\n\n```\nchat: \"research X\"\n  │\n  ▼\nNimbleBrain engine ──┐\n                     │  tools/call (task-augmented)\n                     ▼\n            FastMCP server (this app)\n                     │\n                     ├─► creates research_run entity (status=working)\n                     ├─► spawns worker (asyncio)\n                     │     │\n                     │     ├─► ctx.report_progress  ──► notifications/tasks/status ──► engine\n                     │     └─► app.update_entity    ──► filesystem ──► Synapse UI live stream\n                     │\n                     └─► returns CreateTaskResult immediately\n                         (engine polls tasks/get, retrieves via tasks/result when terminal)\n```\n\nTwo independent channels update in lockstep:\n- **Engine channel** — MCP task status notifications. The engine uses these to render progress in the chat UI and to stabilise polling cadence.\n- **UI channel** — entity writes via Upjack. The Synapse sidebar app reads the entity stream to render a live dashboard of runs.\n\n### UI retry flow\n\nThe 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()`.\n\nLegacy 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.\n\n## Configuration\n\n### Credentials (declared as `user_config` in `manifest.json`)\n\nThe 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`:\n\n| Config key | Env var exposed | Purpose |\n|---|---|---|\n| `anthropic_api_key` | `ANTHROPIC_API_KEY` | Claude LLM — planning + report writing |\n| `tavily_api_key` | `TAVILY_API_KEY` | Web search |\n| `openai_api_key` | `OPENAI_API_KEY` | Embeddings only (`text-embedding-3-small`) |\n\nAll three are required and marked `sensitive: true`.\n\n### Routing (hard-coded in `mcp_config.env`)\n\nNot tenant-tunable in v1 — set directly in the manifest:\n\n```\nRETRIEVER=tavily\nFAST_LLM=anthropic:claude-haiku-4-5\nSMART_LLM=anthropic:claude-sonnet-4-6\nSTRATEGIC_LLM=anthropic:claude-sonnet-4-6\nEMBEDDING=openai:text-embedding-3-small\n```\n\nTo 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.\n\n### Cost and latency\n\n- Typical run: **30s–3min**.\n- Typical cost: **$0.15–$0.60/run** on Sonnet 4.6 + Tavily advanced + OpenAI embeddings.\n- Hard-cap: **5 minutes** via `asyncio.wait_for`. Longer runs are marked `failed` with a timeout error.\n\n## Data layout\n\nOne entity: `research_run`. Lives under:\n```\n$UPJACK_ROOT/apps/research/data/research_runs/{id}.json\n```\n\nData-root resolution priority:\n1. `UPJACK_ROOT` env var\n2. `MPAK_WORKSPACE` env var\n3. `~/.synapse-research` (fallback)\n\nEach workspace spawns its own server process with its own root. There is no cross-workspace state inside the server.\n\n## Running locally\n\n### Install deps\n\n```bash\nuv sync\ncd ui \u0026\u0026 npm install \u0026\u0026 npm run build \u0026\u0026 cd ..\n```\n\n### Stdio (Claude Desktop, any MCP client)\n\n```bash\nuv run python -m mcp_research.server\n```\n\n### HTTP (NimbleBrain platform)\n\n```bash\nuv run uvicorn mcp_research.server:app --port 8002\n```\n\n### Tests (keyless — no API keys required)\n\n```bash\nuv run pytest tests/ -v\n```\n\nThe 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.\n\n## Tool reference\n\n| Tool | Task support | Description |\n|---|---|---|\n| `start_research` | `optional` | The only custom tool. Runs the research worker end-to-end. |\n| `get_research_run` | n/a | Auto-generated entity tool (read by id). |\n| `list_research_runs` | n/a | Auto-generated entity tool. |\n| `search_research_runs` | n/a | Auto-generated entity tool. |\n| `delete_research_run` | n/a | Auto-generated entity tool (soft delete). |\n\nCancellation 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.\n\n## Contributing\n\nSee [CLAUDE.md](CLAUDE.md) for the architecture walkthrough, commands, conventions, and build pipeline.\n\nQuality gates (run before opening a PR):\n\n```bash\nuv run ruff check src/ tests/\nuv run ruff format --check src/ tests/\nuv run ty check src/\nuv run pytest tests/ -v\ncd ui \u0026\u0026 npm ci \u0026\u0026 npm run build\n```\n\nCI enforces the same gates — see `.github/workflows/ci.yml`.\n\n## Ecosystem\n\n- **[NimbleBrain](https://nimblebrain.ai?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)** — the agent platform this app runs on\n- **[mpak](https://mpak.dev?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)** — MCP bundle registry where releases are published\n- **[Upjack](https://upjack.dev?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)** — declarative AI-app framework (entity schemas, skills, hooks)\n- **[Synapse SDK](https://www.npmjs.com/package/@nimblebrain/synapse)** — React hooks powering the UI\n- **[GPT-Researcher](https://github.com/assafelovic/gpt-researcher)** — Apache-2.0 research engine this app wraps\n- **[Discord community](https://nimblebrain.ai/discord?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=synapse-research)**\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimblebraininc%2Fsynapse-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimblebraininc%2Fsynapse-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimblebraininc%2Fsynapse-research/lists"}