Research Workbench MCP
README.md
# Research Workbench MCP
[](https://github.com/AdityaMods955/research-workbench-mcp/actions/workflows/ci.yml)
A local-first Model Context Protocol server for collecting research, searching a source library, exploring tabular data, and generating report files. It uses Node.js 24+, built-in `node:sqlite`, and built-in `fetch`; no native addon is required.
## Features
- Research vault with SQLite FTS5 full-text search, SHA-256 content deduplication, notes, tags, collections, citations, and claim tracking.
- Import web pages, plain text, HTML, PDF, DOCX, XLSX, PPTX, and EPUB sources. Web pages are reduced to readable article text when possible.
- Load CSV, TSV, JSON, or XLSX files into SQLite, run read-only queries, inspect a profile, and export results.
- Produce pure TypeScript SVG bar, line, and pie charts, plus DOCX, PPTX, and PDF reports.
- Connect over MCP Streamable HTTP or stdio.
## Requirements and setup
Requires Node.js 24 or later and pnpm. From the project directory:
```sh
pnpm install
pnpm run typecheck
pnpm run build
pnpm test
```
The vault is stored in `vault.db` and the tabular workspace in `research-data.db` in the current working directory. Set `RESEARCH_VAULT_PATH` and `RESEARCH_DATA_PATH` to choose other locations. These databases are local data and are excluded from Git.
## Architecture
`src/server.ts` registers the MCP tools and transports. `src/vault/` handles source extraction, SQLite storage, FTS5, and research operations. `src/data/` loads and queries tabular data. `src/report/` creates SVG and office/PDF output. The `tests/` suite uses Node's built-in test runner and assertions. GitHub Actions runs typecheck, build, and tests on Node 24.
## Transports
### Streamable HTTP
```sh
pnpm start
# MCP endpoint: http://127.0.0.1:8790/mcp
```
Set `HOST` and `PORT` to change the bind address and port. The default is loopback-only. To require a shared device identifier, set `RESEARCH_DEVICE_ID`; clients must send its value in the `X-Device-Id` header. Keep the server on a trusted network and protect any non-loopback exposure with an authenticated proxy and TLS.
### stdio
```sh
node dist/index.js --stdio
```
stdio is useful when the MCP client launches the server process directly. Build first with `pnpm run build`.
## Tool reference
Arguments are JSON objects. File paths are interpreted by the server process. Outputs are returned as text content, usually JSON; `report_chart_svg` returns SVG text.
| Tool | Main arguments | Purpose |
| --- | --- | --- |
| `research_ingest` | `content`, `title`; or `url`; or `path`, `kind` | Add text, a URL, or a document. `kind`: `pdf`, `docx`, `xlsx`, `pptx`, or `epub`. |
| `research_import` | `path` | Import a JSON array of `{title, content, url?}` records. |
| `research_search` | `query`, `limit?` | Search source titles and text with FTS5. |
| `research_get` | `id` | Retrieve a source by ID. |
| `research_note` | `sourceId` or `id`, `note` | Save a note, optionally linked to a source. |
| `research_tag` | `sourceId` or `id`, `tag` | Add a tag to a source. |
| `research_cite` | `id`, `style?`, `author?` | Format as `markdown`, `apa`, `chicago`, or `bibtex`. |
| `research_refresh` | `url` | Fetch and ingest a fresh URL snapshot; content hashes deduplicate repeats. |
| `research_export` | `path?`, `id?` | Export one source or the full source list as JSON. |
| `research_collection` | `action?`, `name?`, `description?`, `id?` | List collections, `create` one, or `add` a source to one. |
| `research_claim_add` | `claim`, `sourceId?` | Record a claim for later review. |
| `research_claim_verify` | `claimId`, `status?`, `evidence?` | Update claim status and evidence. |
| `data_load` | `path`, `table?` | Load CSV, TSV, JSON array, or first XLSX sheet to SQLite. |
| `data_sql` | `sql`, `cap?` | Run a read-only `SELECT` or `WITH` query; result rows are capped. |
| `data_profile` | `sql?`, `cap?` | Profile the rows returned by a query. |
| `data_export` | `path?`, `sql?`, `cap?` | Write query results to JSON. |
| `report_chart_svg` | `chartType`, `points`, `title?` | Return SVG for `bar`, `line`, or `pie`; points are `{label, value}`. |
| `report_docx` | `path?`, `title?`, `body?` | Write a DOCX document. |
| `report_pptx` | `path?`, `title?`, `body?` | Write a one-slide PPTX presentation. |
| `report_pdf` | `path?`, `title?`, `body?` | Write a PDF document. |
## MCP client configuration
The examples below assume the project has been cloned and built at `/absolute/path/research-workbench-mcp`.
### AntiGem
Add a local MCP server in AntiGem's MCP settings using the HTTP endpoint `http://127.0.0.1:8790/mcp`. If launching over stdio, configure the command and arguments:
```json
{"command":"node","args":["/absolute/path/research-workbench-mcp/dist/index.js","--stdio"],"cwd":"/absolute/path/research-workbench-mcp"}
```
### OpenCode
In `opencode.json`:
```json
{"mcp":{"research-workbench":{"type":"local","command":["node","/absolute/path/research-workbench-mcp/dist/index.js","--stdio"],"enabled":true}}}
```
### Codex
In `~/.codex/config.toml`:
```toml
[mcp_servers.research_workbench]
command = "node"
args = ["/absolute/path/research-workbench-mcp/dist/index.js", "--stdio"]
```
### Gemini CLI
In `~/.gemini/settings.json`:
```json
{"mcpServers":{"research-workbench":{"command":"node","args":["/absolute/path/research-workbench-mcp/dist/index.js","--stdio"]}}}
```
## Safety and data notes
Only connect clients you trust. Tools that ingest URLs make outbound requests from the server; use them only for URLs you expect to fetch. Data query SQL rejects mutation keywords and multiple statements and uses a row cap, but a local database should still be treated as trusted input. Reports and exports are written to the paths you provide.
## License
MIT. See [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues