MCP server for HumanChain — AI agents pause for human expert guidance via the consult() tool.
Project description
humanchain-mcp
MCP server for HumanChain — AI agents pause for human expert guidance via a single
consulttool.
Wires HumanChain into any MCP-aware coding agent (Claude Desktop, Cursor,
Continue, Claude Code, Cody, …). When your agent hits a question that
needs human judgment, it calls consult(); a vetted human answers; the
agent continues with a grounded response. If no human is online, a
single-voice LLM fallback (Groq Llama 3.3 70B) answers in their place.
Full documentation: https://humanchain.ai/docs
Install
pip install humanchain-mcp
Requires Python 3.10+.
Configure your agent
Sign up at https://humanchain.ai/signup and grab an API key, then add the server to your agent's MCP config:
{
"mcpServers": {
"humanchain": {
"command": "python",
"args": ["-m", "humanchain_mcp"],
"env": {
"HUMANCHAIN_API_KEY": "hc_your_key_here"
}
}
}
}
Restart your agent. The consult tool is now available.
Environment variables
| Variable | Default | Description |
|---|---|---|
HUMANCHAIN_API_KEY |
(required) | Your account API key. |
HUMANCHAIN_BACKEND |
https://humanchain-hub-demo.fly.dev |
Hub backend URL. Override for self-hosted. |
HUMANCHAIN_MODE |
live |
Set to sandbox to return synthetic responses without network calls. |
HUMANCHAIN_TIMEOUT_MS |
5000 |
HTTP timeout for Hub calls. (Distinct from consult.wait_seconds.) |
HUMANCHAIN_LOG_LEVEL |
INFO |
Server log level. |
The consult tool
The MCP server registers a single tool named consult. Its signature
matches the documented Python SDK:
consult(
question: str,
domain_tags: list[str] | None = None,
target_responses: int = 1,
approval_method: Literal[
"fastest", "consensus", "best_of_n", "all_must_agree"
] = "fastest",
wait_seconds: int = 60,
bypass_on_timeout: bool = True,
require_human: bool = False,
context_brief: str | None = None,
) -> ConsultResponse
See the API reference for
the full parameter and response shape, error types, and the @hc/...
shorthand mapping.
Sandbox mode
Set HUMANCHAIN_MODE=sandbox and the server returns structurally-valid
synthetic ConsultResponse objects without hitting the network. Use
this in CI, agent unit tests, and during integration development —
no credits burned, no humans woken.
Self-hosted backend
If you're running a self-hosted Hub, set HUMANCHAIN_BACKEND to your
deployment URL. The MCP server speaks the same /api/agent/consult
contract regardless of where the Hub is hosted.
Development
git clone https://github.com/M-C-Sigma/humanchain-the-hub
cd humanchain-the-hub/humanchain-mcp
pip install -e ".[dev]"
pytest
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file humanchain_mcp-0.15.0.tar.gz.
File metadata
- Download URL: humanchain_mcp-0.15.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84291c4ea6cf1cf6fe2c810ca5cbe4a22ec1549f2a10ca2acf56bbfb64863dca
|
|
| MD5 |
ff169c930ea3b5428bffda9e7327582c
|
|
| BLAKE2b-256 |
a5f47e01313e35ce07b5618d6655046caa736c77bd4e6a8d4595106e613d435c
|
File details
Details for the file humanchain_mcp-0.15.0-py3-none-any.whl.
File metadata
- Download URL: humanchain_mcp-0.15.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33a4d61ab7ed53c4f4af9c915f4311e5d7ae3173dc016624ae806a683adecbe2
|
|
| MD5 |
5561ae66b57eb555f41e01469c63c7b8
|
|
| BLAKE2b-256 |
5064ef22d60e7d05dc4b336bc04758d5a2e5b91f268d3143dd4ff255b591e68f
|