Documentation

Everything you need to know about OSIA

MCP Connectors

Model Context Protocol (MCP) allows OSIA to dynamically extend its capabilities with external tools and services.

How MCP Works

  1. 1. Registration: MCP tools are registered in TOOL_MAP
  2. 2. Naming: Tools are namespaced as mcp__server__tool
  3. 3. Integration: Tools appear in system prompt alongside native tools
  4. 4. Execution: Called synchronously, return string results

Configuration

{
  "connectors": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "your-token" }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/data"]
    }
  }
}

Architecture

MCP uses a dedicated asyncio event loop in a daemon thread with sync wrappers for the agent dispatch system. Secrets are stored in config/api_keys.json (gitignored) with key format mcp:<id>.