@biomate/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +77 -0
- package/dist/tools_manifest.json +2335 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @biomate/mcp-server
|
|
2
|
+
|
|
3
|
+
BioMate MCP server — exposes 19 scientific workflow tools to any MCP-compatible AI host (Claude Code, Claude Desktop, Cursor, Codex CLI).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Add to your Claude Code or Claude Desktop config:
|
|
8
|
+
|
|
9
|
+
**`~/.mcp.json`** (Claude Code):
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"mcpServers": {
|
|
13
|
+
"biomate": {
|
|
14
|
+
"command": "npx",
|
|
15
|
+
"args": ["-y", "@biomate/mcp-server"],
|
|
16
|
+
"env": {
|
|
17
|
+
"BIOMATE_API_KEY": "bm_live_your_key_here"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Get your API key at **[dev-public.biomate.ai/account/api-keys](https://dev-public.biomate.ai/account/api-keys)**.
|
|
25
|
+
|
|
26
|
+
## Tools (19)
|
|
27
|
+
|
|
28
|
+
| Tool | Purpose |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `biomate_session` | Primary: natural-language goal → full workflow execution |
|
|
31
|
+
| `search_workflow` | Search 2,455 indexed workflows by natural language |
|
|
32
|
+
| `get_workflow_spec` | Full parameter spec for a workflow |
|
|
33
|
+
| `run_workflow` | Execute with explicit parameters |
|
|
34
|
+
| `get_run` / `watch_run` | Status, phases, steps, outputs |
|
|
35
|
+
| `cancel_run` | Cancel a running job |
|
|
36
|
+
| `list_runs` | History with filters |
|
|
37
|
+
| `preview_file` | Server-side preview of output files |
|
|
38
|
+
| `export_report` | PDF/markdown publication report |
|
|
39
|
+
| `analyze_results` | AI interpretation of findings |
|
|
40
|
+
| `explain_error` | Root-cause diagnosis for failed runs |
|
|
41
|
+
| `query_database` | UniProt, PDB, NCBI, ChEMBL, AlphaFold |
|
|
42
|
+
| `resolve_accession` | GEO/SRA/ENA → auto-run GEO data connector |
|
|
43
|
+
| `browse_data` / `fetch_public_data` | Browse and stage public datasets |
|
|
44
|
+
| `upload_file` | Get signed S3 PUT URL for local uploads |
|
|
45
|
+
| `recall_memory` | Retrieve relevant prior runs and procedures |
|
|
46
|
+
| `search_literature` | PubMed, Semantic Scholar, OpenAlex |
|
|
47
|
+
|
|
48
|
+
## Environment variables
|
|
49
|
+
|
|
50
|
+
| Variable | Description |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `BIOMATE_API_KEY` | Personal API key (`bm_live_xxx`) — required |
|
|
53
|
+
| `BIOMATE_API_BASE` | BioMate server URL (default: `https://dev-public.biomate.ai`) |
|
|
54
|
+
|
|
55
|
+
## Example
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
> Screen aspirin and caffeine for hERG inhibition and CYP3A4 metabolism.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
> Run RNA-seq differential expression on s3://bucket/exp1/ — human GRCh38, treated vs control.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
> Fetch GSE183947 from GEO and run the DESeq2 pipeline.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT — this package only. BioMate platform usage governed by [biomate.ai/terms](https://biomate.ai/terms).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @biomate/mcp-server
|
|
4
|
+
*
|
|
5
|
+
* MCP stdio server that exposes BioMate's scientific workflow capabilities
|
|
6
|
+
* to any MCP-compatible AI host (Claude Code, Claude Desktop, Cursor, Codex CLI).
|
|
7
|
+
*
|
|
8
|
+
* Configuration (environment variables):
|
|
9
|
+
* BIOMATE_API_BASE BioMate server URL (default: https://dev-public.biomate.ai)
|
|
10
|
+
* BIOMATE_API_KEY Personal API key (bm_live_xxx) from biomate.ai/account/api-keys
|
|
11
|
+
* BIOMATE_REFRESH_TOKEN OAuth refresh token (alternative to API key)
|
|
12
|
+
*
|
|
13
|
+
* Each tool call POSTs to ${BIOMATE_API_BASE}/tools/${toolName} with the
|
|
14
|
+
* Authorization header set. The /tools/* routes are served by BioMate's
|
|
15
|
+
* Node.js API server.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @biomate/mcp-server
|
|
4
|
+
*
|
|
5
|
+
* MCP stdio server that exposes BioMate's scientific workflow capabilities
|
|
6
|
+
* to any MCP-compatible AI host (Claude Code, Claude Desktop, Cursor, Codex CLI).
|
|
7
|
+
*
|
|
8
|
+
* Configuration (environment variables):
|
|
9
|
+
* BIOMATE_API_BASE BioMate server URL (default: https://dev-public.biomate.ai)
|
|
10
|
+
* BIOMATE_API_KEY Personal API key (bm_live_xxx) from biomate.ai/account/api-keys
|
|
11
|
+
* BIOMATE_REFRESH_TOKEN OAuth refresh token (alternative to API key)
|
|
12
|
+
*
|
|
13
|
+
* Each tool call POSTs to ${BIOMATE_API_BASE}/tools/${toolName} with the
|
|
14
|
+
* Authorization header set. The /tools/* routes are served by BioMate's
|
|
15
|
+
* Node.js API server.
|
|
16
|
+
*/
|
|
17
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
18
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
20
|
+
import { createRequire } from "module";
|
|
21
|
+
const require = createRequire(import.meta.url);
|
|
22
|
+
// ── Config ────────────────────────────────────────────────────────────────────
|
|
23
|
+
const API_BASE = (process.env.BIOMATE_API_BASE ?? "https://dev-public.biomate.ai").replace(/\/$/, "");
|
|
24
|
+
const API_KEY = process.env.BIOMATE_API_KEY ?? process.env.BIOMATE_REFRESH_TOKEN ?? "";
|
|
25
|
+
// ── Tools manifest ────────────────────────────────────────────────────────────
|
|
26
|
+
const manifest = require("./tools_manifest.json");
|
|
27
|
+
const TOOLS = manifest.mcp.map((t) => ({
|
|
28
|
+
name: t.name,
|
|
29
|
+
description: t.description,
|
|
30
|
+
inputSchema: t.inputSchema,
|
|
31
|
+
}));
|
|
32
|
+
// ── Server ────────────────────────────────────────────────────────────────────
|
|
33
|
+
const server = new Server({ name: "biomate", version: "2.0.0" }, { capabilities: { tools: {} } });
|
|
34
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
35
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
36
|
+
const { name, arguments: args } = req.params;
|
|
37
|
+
const headers = {
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
if (API_KEY) {
|
|
41
|
+
headers["Authorization"] = `Bearer ${API_KEY}`;
|
|
42
|
+
}
|
|
43
|
+
let data;
|
|
44
|
+
let ok = true;
|
|
45
|
+
try {
|
|
46
|
+
const res = await fetch(`${API_BASE}/tools/${name}`, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers,
|
|
49
|
+
body: JSON.stringify(args ?? {}),
|
|
50
|
+
signal: AbortSignal.timeout(120_000),
|
|
51
|
+
});
|
|
52
|
+
ok = res.ok;
|
|
53
|
+
try {
|
|
54
|
+
data = await res.json();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
data = { error: `HTTP ${res.status}: ${res.statusText}` };
|
|
58
|
+
ok = false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
63
|
+
data = { error: msg };
|
|
64
|
+
ok = false;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
68
|
+
isError: !ok,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
// ── Start ─────────────────────────────────────────────────────────────────────
|
|
72
|
+
if (!API_KEY) {
|
|
73
|
+
process.stderr.write("[biomate-mcp] WARNING: BIOMATE_API_KEY not set. " +
|
|
74
|
+
"Get your key at https://dev-public.biomate.ai/account/api-keys\n");
|
|
75
|
+
}
|
|
76
|
+
const transport = new StdioServerTransport();
|
|
77
|
+
await server.connect(transport);
|