Skip to content

feat(mcp): native MCP client with full spec support#64

Closed
eren-karakus0 wants to merge 1 commit into
NousResearch:mainfrom
eren-karakus0:feat/mcp-full-spec
Closed

feat(mcp): native MCP client with full spec support#64
eren-karakus0 wants to merge 1 commit into
NousResearch:mainfrom
eren-karakus0:feat/mcp-full-spec

Conversation

@eren-karakus0

@eren-karakus0 eren-karakus0 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a native Model Context Protocol (MCP) client implementation that enables Hermes Agent to connect to any MCP-compatible tool server. This covers the full 2024-11-05 MCP specification.

What's Included

  • Transport Layer Stdio and Streamable HTTP transports with automatic reconnection and exponential backoff
  • Multi-Server Orchestration MCPManager handles concurrent server connections with per-server config (mcp_servers.json)
  • Full Spec Coverage:
    • Tools: discover, call, and list-changed notifications
    • Resources: list, read, subscribe, and resource-update notifications
    • Prompts: list, get, and list-changed notifications
    • Progress: bidirectional progress notifications with token tracking
    • Logging: configurable log levels with setLevel support
  • Meta-Tool Interface Single mcp tool with actions: status, connect, disconnect, reconnect, list_tools, call_tool, list_resources, read_resource, list_prompts, get_prompt, set_log_level
  • Skill Integration skills/mcp/native-mcp/SKILL.md for natural language guidance
  • Demo Files demo_mcp_server.py (example server) and demo_mcp_client.py (standalone test client)
  • 85 Unit Tests Full coverage across all modules

Architecture

tools/mcp_client.py    Transport + protocol layer (JSON-RPC 2.0)
tools/mcp_manager.py   Multi-server lifecycle management
tools/mcp_tool.py      Meta-tool handler (registered in toolsets)

Demo Screenshots

MCP Tool Calls:

demomcp1 demomcp2 demomcp3

Test Results (85/85 passing):

mcptest1 mcptest2 ## Test Plan
  • python -m pytest tests/test_mcp.py -v 85/85 tests passing
  • Manual test with demo_mcp_server.py + demo_mcp_client.py
  • Integration test with real MCP servers (e.g. filesystem, brave-search)

Why This Matters

No other AI agent framework provides full MCP spec coverage as a native integration. Most competitors only support basic tool calls this implementation adds resources, prompts, progress tracking, logging, and dynamic list-changed notifications, making Hermes Agent the most MCP-complete agent available.

Implement native Model Context Protocol (MCP) client that enables
Hermes Agent to connect to any MCP-compatible tool server. Covers the
full 2024-11-05 spec including:

- Stdio and Streamable HTTP transports with auto-reconnect
- Multi-server orchestration via MCPManager
- Resources (read, subscribe) and Prompts (list, get)
- Progress notifications with token tracking
- Bidirectional logging with configurable log levels
- Dynamic list-changed notifications (tools, resources, prompts)
- Meta-tool interface for status, reconnect, and server management
- 85 unit tests with full coverage
- Demo client and server for quick testing

Co-Authored-By: Eren Karakus <eren-karakus0@users.noreply.github.com>

@Bartok9 Bartok9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent MCP implementation! 🎉

Strengths:

  • Full 2024-11-05 spec coverage
  • Clean architecture (transport → manager → tool layers)
  • 85 tests is impressive coverage
  • Multi-server support with reconnection logic
  • Good documentation with demo files

The meta-tool approach is smart — single entry point with actions (status, connect, call_tool, etc.) keeps the tool interface clean while exposing full MCP capabilities.

Minor suggestions for future:

  • Consider adding a /mcp slash command for quick status checks
  • Resource caching could help with frequently-read resources

Ready to ship! 🚀

@inho1019 inho1019 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - MCP full spec implementation looks solid.

jarvis-stark-ops added a commit to 1Team-Engineering/hermes-agent that referenced this pull request Jun 10, 2026
…sResearch#62, NousResearch#64)

Adds three pre-write-txn gates in `complete_task` mirroring the
existing `_verify_created_cards` / `HallucinatedCardsError` pattern:

- `verify_runtime_floor` (closes hermes-jarvis#64) — per-role floor
  on completed_at - started_at. Build 5min, review 90s, orchestration 0.
- `verify_workspace_diff` (closes hermes-jarvis#62) — non-review
  workers on dir/worktree workspaces must produce a non-empty
  git diff against the tracking base.
- `verify_no_stray_artifacts` (closes hermes-jarvis#28) — rejects
  *evidence*, commit-hash*, triage/*, tmp-*, and untracked
  no-extension/no-shebang files (the agent-dashboard PR #1
  "all prior block evidence files" failure mode).

Opt-outs via metadata (x_fast_justified / x_no_code / x_stray_ok)
require ≥20-char string reasons and emit completion_opt_out_used
audit events with verbatim reason. Truthy bools or short strings
rejected with InvalidOptOutError.

Context: hermes-jarvis#61 (bootstrap-paradox case study).

41 tests pass; 258 wider regression — zero failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants