Skip to content

Comments

feat(mcp): add mcp client and server#1300

Open
paul-nechifor wants to merge 1 commit intodevfrom
paul/feat/mcp-server
Open

feat(mcp): add mcp client and server#1300
paul-nechifor wants to merge 1 commit intodevfrom
paul/feat/mcp-server

Conversation

@paul-nechifor
Copy link
Contributor

@paul-nechifor paul-nechifor commented Feb 19, 2026

Problem

We need to move towards greater support for MCP.

Closes DIM-533

https://linear.app/dimensional/issue/DIM-533/add-mcp-client-and-server

Solution

  • Moving towards deprecating Agent. It has been efectivelly split between McpClient and McpServer.
  • McpServer exposes all the @skill functions as MCP tools.
  • McpClient starts a langchain agent which coordinates calling tools from McpServer.
  • McpClient is not strictly necessary. You can register the MCP server in claude code and make it call tools.
  • McpClient also listens to /human_input so it can be used through the humancli like Agent can.

Next tasks:

  • Adding an easy way of exposing MCP tasks.

Breaking Changes

None

How to Test

Run

uv run dimos run unitree-go2-agentic-mcp

...instead of unitree-go2-agentic and interact with it the same way through humancli: start exploring, stop, move forward 2 meters, etc.

@greptile-apps
Copy link

greptile-apps bot commented Feb 19, 2026

Greptile Summary

Refactored MCP implementation from TCP-based stdio bridge to direct HTTP-based FastAPI server/client architecture. The new approach simplifies the integration with Claude Code by removing the intermediate bridge layer and using HTTP JSON-RPC directly.

Major Changes:

  • Moved MCP implementation from dimos/protocol/mcp/ to dimos/agents/mcp/
  • Replaced TCP socket server with FastAPI HTTP server (McpServer) on port 9990
  • Created HTTP-based MCP client (McpClient) using httpx for JSON-RPC communication
  • Removed dependency on mcp>=1.0.0 package, implementing custom JSON-RPC handlers
  • Added comprehensive test coverage (integration and unit tests) with fixture-based testing
  • Updated unitree_go2_agentic_mcp blueprint to use new client/server modules

Issues Found:

  • Critical: test_mcp_client.py:62 returns ValueError instead of raising it, breaking error handling logic
  • Critical: test_mcp_server.py:105 assertion will fail due to mismatched error response format
  • Minor: Grammar error in mcp_client.py:150 ("You will updated")
  • Minor: Typo in README.md:25 ("youse")

Confidence Score: 3/5

  • PR has solid architecture but contains critical test bugs that will cause runtime failures
  • The refactoring from TCP to HTTP is well-designed and the core implementation is sound. However, there are two critical bugs in test code: ValueError being returned instead of raised (line 62 in test_mcp_client.py) and a failing assertion (line 105 in test_mcp_server.py). These will cause test failures and indicate the tests haven't been fully validated. The grammar/typo errors are minor but should be fixed.
  • Pay close attention to dimos/agents/mcp/test_mcp_client.py and dimos/agents/mcp/test_mcp_server.py for the critical logic errors

Important Files Changed

Filename Overview
dimos/agents/mcp/README.md comprehensive documentation for MCP server setup and usage, contains typo on line 25
dimos/agents/mcp/mcp_client.py MCP client implementation with HTTP-based JSON-RPC communication to MCP server, contains grammar error on line 150
dimos/agents/mcp/mcp_server.py FastAPI-based MCP server exposing robot skills as MCP tools, well-structured with proper error handling
dimos/agents/mcp/test_mcp_client.py integration tests for MCP client, contains critical bug on line 62 where ValueError is returned instead of raised
dimos/agents/mcp/test_mcp_server.py unit tests for MCP server request handling, contains assertion issue on line 105
dimos/robot/unitree/go2/blueprints/agentic/unitree_go2_agentic_mcp.py updated to use new MCP client/server architecture with autoconnect

Sequence Diagram

sequenceDiagram
    participant Claude as Claude Code
    participant Client as McpClient
    participant Server as McpServer
    participant Skills as Robot Skills

    Note over Claude,Skills: Initialization Phase
    Claude->>Server: HTTP POST /mcp (initialize)
    Server-->>Claude: Server capabilities & info
    Claude->>Server: HTTP POST /mcp (tools/list)
    Server->>Skills: get_skills()
    Skills-->>Server: List of SkillInfo
    Server-->>Claude: Available tools with schemas

    Note over Claude,Skills: Tool Execution Phase
    Claude->>Client: Human input message
    Client->>Client: Queue message
    Client->>Client: LangChain agent processes
    Client->>Server: HTTP POST /mcp (tools/call)
    Server->>Skills: RPC call to skill
    Skills-->>Server: Result or None
    Server-->>Client: JSON-RPC result
    Client->>Client: Append to history
    Client->>Claude: Publish agent message

    Note over Client,Skills: Image Handling
    Skills-->>Server: Result with agent_encode()
    Server-->>Client: Content with image data
    Client->>Client: Add UUID, append to history
    Client->>Claude: Tool response + image message
Loading

Last reviewed commit: 2fdf0cb

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

27 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@spomichter
Copy link
Contributor

@paul-nechifor should we just fork openclaw? Theyve build a lot of robust MCP and hosted gateway infra, runs on all architectures, etc

@paul-nechifor
Copy link
Contributor Author

@paul-nechifor should we just fork openclaw? Theyve build a lot of robust MCP and hosted gateway infra, runs on all architectures, etc

I don't think we need to fork openclaw, we just want to connect it to our MCP server. And we'll want to publish a SKILL.md file to ClawHub so openclaw knows how to use our server.

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.

2 participants