[Integration]: OnlineCompiler.io (run and judge code from a Haystack Agent over MCP)

未关闭
#774 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 13 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
ai, documentation

调研方向

The requested change is a documentation listing for the OnlineCompiler.io integration, with a working example in the issue body. Read the existing Unstructured Transform MCP and Prior Labs pages for the expected format, then prepare the OnlineCompiler.io page using the details and examples here. Done means the integration is listed consistently with those pages; the draft page was in #752 and is to be reopened as a new pull request after approval.

由索引模型根据 Issue 内容生成。

描述

Stage

Ready: integration exists and works, proposing to list it

Integration or project name

OnlineCompiler.io

Integration type

Tool Integration

Published package or repo (if it exists)

https://pypi.org/project/onlinecompiler-mcp/ and https://github.com/onlinecompiler-io/onlinecompiler-mcp (used through mcp-haystack's MCPToolset; no new package)

Need or proof of use

A Haystack Agent or pipeline can run untrusted code in 46 languages and judge it against test cases through mcp-haystack, with no sandbox to host: each run happens in a fresh sandbox with no network on our side.

Tested on 21 Nov 2026 with haystack-ai 3.5.0, mcp-haystack 2.1.2 and mcp 2.3.0, against the live hosted server. This snippet from the draft page grades a submission against two test cases and returns "verdict": "accepted", "score": 100.0 and one entry per test:

from haystack.utils import Secret
from haystack_integrations.tools.mcp import MCPToolset, StreamableHttpServerInfo

toolset = MCPToolset(
    server_info=StreamableHttpServerInfo(
        url="https://api.onlinecompiler.io/mcp",
        token=Secret.from_env_var("ONLINECOMPILER_API_KEY"),
    ),
    tool_names=["run_tests"],
    eager_connect=True,
    invocation_timeout=60,
)
run_tests = toolset.tools[0]
result = run_tests.invoke(
    compiler="python-3.14",
    code="a, b = map(int, input().split())\nprint(a + b)",
    tests=[
        {"input": "2 3", "expected_output": "5"},
        {"input": "10 -4", "expected_output": "6"},
    ],
)
print(result)

The same day we also ran the page's other blocks: the hosted server's tool list, the server run locally with uvx onlinecompiler-mcp, and the Agent example (with a scripted chat model standing in for the LLM).

Short description

Lets a Haystack Agent run code and check it against test cases: agents that verify the code they write before answering, and grading pipelines that judge a program against hidden tests. The MCP server has four tools: list_compilers, run_code, run_tests (a verdict per test case and a score) and judge_problem (a problem stored in the user's account, with a signed receipt). OnlineCompiler.io is a hosted service with a free tier; we make it and maintain the MCP server. The page would be documentation only, like the Unstructured Transform MCP and Prior Labs pages. This replaces #751; the draft page is in #752, which we'll open again as a new PR once this is approved.

主要语言
Python
星标
114
派生
324
平均合并
7 天 2 小时
30 天内合并 PR
13

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

deepset-ai/haystack-integrations 的其他 Issue

查看 deepset-ai/haystack-integrations 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。