Skip to content

MCP (Model Context Protocol)

Wilson supports Model Context Protocol (MCP) servers, allowing you to extend its capabilities with external tools. MCP is an open standard for connecting AI models to external data sources and tools.

Add MCP servers in ~/.agentwilson/mcp.json:

{
"servers": {
"my-server": {
"command": "npx",
"args": ["-y", "my-mcp-server"],
"env": {}
}
}
}
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
"env": {}
},
"web-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your-key"
}
}
}
}
  1. Startup — Wilson reads ~/.agentwilson/mcp.json and starts configured MCP servers as child processes
  2. Discovery — Each server advertises its available tools via the MCP protocol
  3. Registration — Discovered tools are added to Wilson’s tool registry alongside built-in tools
  4. Execution — When the AI decides to use an MCP tool, Wilson routes the call to the appropriate server
  5. Results — Tool results are returned to the AI agent loop like any other tool result

Wilson’s MCP implementation consists of three modules:

ModuleFileRole
Configsrc/mcp/config.tsReads and validates mcp.json
Clientsrc/mcp/client.tsManages MCP server lifecycle and communication
Adaptersrc/mcp/adapter.tsConverts MCP tools to Wilson’s internal tool format
  • Custom data sources — Connect Wilson to proprietary APIs or databases
  • Specialized calculations — Add domain-specific computation tools
  • External services — Integrate with accounting software, banks, or other fintech APIs
  • File access — Give Wilson read/write access to specific directories
  • MCP servers run as child processes on your local machine
  • Each server must implement the MCP protocol
  • Server crashes are isolated — other tools continue to work
  • MCP tools are available alongside (not replacing) Wilson’s built-in tools