MCP (Model Context Protocol)
Overview
Section titled “Overview”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.
Configuration
Section titled “Configuration”Add MCP servers in ~/.agentwilson/mcp.json:
{ "servers": { "my-server": { "command": "npx", "args": ["-y", "my-mcp-server"], "env": {} } }}Multiple Servers
Section titled “Multiple Servers”{ "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" } } }}How It Works
Section titled “How It Works”- Startup — Wilson reads
~/.agentwilson/mcp.jsonand starts configured MCP servers as child processes - Discovery — Each server advertises its available tools via the MCP protocol
- Registration — Discovered tools are added to Wilson’s tool registry alongside built-in tools
- Execution — When the AI decides to use an MCP tool, Wilson routes the call to the appropriate server
- Results — Tool results are returned to the AI agent loop like any other tool result
Architecture
Section titled “Architecture”Wilson’s MCP implementation consists of three modules:
| Module | File | Role |
|---|---|---|
| Config | src/mcp/config.ts | Reads and validates mcp.json |
| Client | src/mcp/client.ts | Manages MCP server lifecycle and communication |
| Adapter | src/mcp/adapter.ts | Converts MCP tools to Wilson’s internal tool format |
Use Cases
Section titled “Use Cases”- 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
Limitations
Section titled “Limitations”- 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