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

Open
#774 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 13 days

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
ai, documentation

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
114
Forks
324
Avg merge
7d 2h
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from deepset-ai/haystack-integrations

All issues in deepset-ai/haystack-integrations

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.