Pakunoda-MCP

Pakunoda-MCP

MCP server that exposes Pakunoda project state to AI agents, providing resources, tools, and prompts for inspecting candidates, scores, and triggering hyperparameter searches.

Category
访问服务器

README

Pakunoda-MCP

MCP server that exposes Pakunoda project state to AI agents.

v0.1.0 — 7 resources, 10 tools (8 read / 2 write), 2 prompts. No arbitrary shell execution, no direct solver parameter control. See release notes.

Responsibility split

Concern Owner
Data ingestion, validation, candidate enumeration, compilation Pakunoda
Solver execution (mwTensor) Pakunoda (via R bridge)
Hyperparameter search (Optuna) Pakunoda
Workflow orchestration (Snakemake) Pakunoda
Exposing results to AI agents (MCP resources + tools) Pakunoda-MCP
Triggering search pipeline (high-level, via Snakemake CLI) Pakunoda-MCP

Pakunoda-MCP reads the results directory that Pakunoda produces. Write tools invoke Snakemake as a subprocess with an allow-listed target — they do not import Pakunoda internals or execute arbitrary commands.

MCP interface

Category Count Examples
Resources 7 pakunoda://project/config, pakunoda://search/trials, ...
Tools (read) 8 validate_project, enumerate_candidates, get_candidate_score, ...
Tools (write) 2 run_search, refresh_project_state
Prompts 2 inspect_project, compare_candidates

Read-only tools follow a list → detail pattern: enumerate_candidatesget_candidate_details / get_candidate_problem / get_candidate_result / get_candidate_score

Write tool run_search verifies that project.id in the target config matches the current results directory, rejecting mismatches before any subprocess runs.

For full parameter and return value details, see docs/api.md.

Environment variables

Pakunoda-MCP uses two environment variables to separate read and write concerns:

Variable Purpose Required for
PAKUNODA_RESULTS_DIR Path to a Pakunoda results directory (e.g. results/my_project). Used by all resources and read-only tools. All operations
PAKUNODA_REPO_DIR Path to the Pakunoda repository root (the directory containing Snakefile). Used by run_search to pin the execution context. Write tools only

Why two variables? The results directory and the Pakunoda repo may live in different locations. Read-only operations need only the results. Write tools need the repo to locate the Snakefile — they run Snakemake with cwd=PAKUNODA_REPO_DIR and an absolute --snakefile path, so the server's own working directory is irrelevant.

Quick start

pip install -e .

# Required: results directory produced by Pakunoda
export PAKUNODA_RESULTS_DIR=/path/to/results/my_project

# Optional: Pakunoda repo root (only needed for run_search)
export PAKUNODA_REPO_DIR=/path/to/Pakunoda

pakunoda-mcp

Claude Code

Add to ~/.claude/settings.json or project .mcp.json:

{
  "mcpServers": {
    "pakunoda": {
      "command": "pakunoda-mcp",
      "env": {
        "PAKUNODA_RESULTS_DIR": "/path/to/results/my_project"
      }
    }
  }
}

If you also want write tools (run_search), add PAKUNODA_REPO_DIR:

{
  "mcpServers": {
    "pakunoda": {
      "command": "pakunoda-mcp",
      "env": {
        "PAKUNODA_RESULTS_DIR": "/path/to/results/my_project",
        "PAKUNODA_REPO_DIR": "/path/to/Pakunoda"
      }
    }
  }
}

Docker

docker build -t pakunoda-mcp .

# Read-only (no PAKUNODA_REPO_DIR needed)
docker run --rm \
  -v /path/to/results:/data:ro \
  -e PAKUNODA_RESULTS_DIR=/data/my_project \
  -i pakunoda-mcp

# With write tools
docker run --rm \
  -v /path/to/results:/data \
  -v /path/to/Pakunoda:/repo:ro \
  -e PAKUNODA_RESULTS_DIR=/data/my_project \
  -e PAKUNODA_REPO_DIR=/repo \
  -i pakunoda-mcp

Usage examples

Read-only: inspect a project

Use the inspect_project prompt to walk through a standard check:

> Use the inspect_project prompt
(Agent calls validate_project → enumerate_candidates → summarize_search → recommend_model)

Or call tools directly:

> What candidates does this project have?
(Agent calls enumerate_candidates)

> Show me the score for c0_expression_methylation
(Agent calls get_candidate_score("c0_expression_methylation"))

Read-only: compare two candidates

> Use the compare_candidates prompt with c0_alpha and c1_beta
(Agent calls get_candidate_details / get_candidate_problem /
 get_candidate_result / get_candidate_score for each, then summarizes)

Write: run a search

> Run a hyperparameter search with 50 trials
(Agent calls run_search(project_path="/path/to/config.yaml", max_trials=50))
(Agent calls refresh_project_state to see updated results)

run_search checks that project.id in the target config matches the current results directory. A mismatch is rejected before any subprocess runs.

Development

pip install -e .
pytest

Current limitations

  • Minimal write: only run_search (via Snakemake subprocess) — no config generation, no freeze/release
  • No arbitrary execution: runner has a fixed allow-list of Snakemake targets
  • Single project: one results directory per server instance
  • stdio only: no HTTP/SSE transport
  • No auth: intended for local use

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选