Chapter 10

MCP Integration

A standardized connection to the outside world

What Is MCP?

MCP stands for Model Context Protocol, proposed by Anthropic. The problem it solves: how do you enable standardized communication between different Agents and different external services? Before MCP, every Agent needed custom code to connect to external services (like GitHub, Slack, databases). With MCP, as long as an external service provides an MCP Server, any MCP-compatible Agent can immediately use it.
ComparisonWithout MCPWith MCP
Adding a new serviceEach Agent writes custom integration codeService provides an MCP Server, all Agents use it directly
Interface formatDifferent format for every serviceUnified JSON-RPC protocol
Tool discoveryHardcodedDynamic discovery, runtime registration
Ecosystem reuseEveryone builds their own, duplicated effortCommunity-built, develop once use everywhere

Three Core MCP Concepts

1. MCP Server The external service that provides tools and resources. For example, a GitHub MCP Server can provide tools like "create PR" and "view issue." 2. MCP Client The connector on the Agent side, responsible for communicating with MCP Servers. OpenHarness has a built-in MCP Client. 3. MCP Tool Tools exposed by an MCP Server. These tools are dynamically registered into the Agent's tool list, and the LLM can use them just like built-in tools.

Configuring MCP Servers

settings.json
1{
2 "mcp_servers": {
3 "github": {
4 "command": "npx",
5 "args": ["-y", "@modelcontextprotocol/server-github"],
6 "env": {
7 "GITHUB_TOKEN": "your-token"
8 }
9 },
10 "filesystem": {
11 "command": "npx",
12 "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
13 }
14 }
15}

Configure the MCP Servers you want to connect to in settings.json:

How MCP Works in OpenHarness

1. At startup, OpenHarness reads the MCP Server list from configuration 2. Establishes a connection to each Server (via MCPClientManager) 3. Queries each Server for the tools it provides 4. Dynamically registers those tools into the tool registry 5. The LLM sees these MCP tools in its tool list and can call them normally 6. When called, the request is forwarded through the MCP Client to the corresponding Server The entire process is transparent to the LLM — it doesn't distinguish between built-in tools and MCP tools.
📌 Key Takeaway
MCP = A Standardized Extension Interface
MCP means Agent capabilities are no longer limited to built-in tools. Through this standard protocol, an Agent can connect to any external service. This is the key to Agent ecosystem growth — the community can collaboratively build MCP Servers, and every MCP-compatible Agent benefits.
🧠 Check Your Understanding
What core problem does MCP solve?