Melian

MCP

Overview

Melian supports the Model Context Protocol (MCP), allowing external tools and services to be connected as MCP servers. MCP tools are registered dynamically at runtime and appear alongside Melian's built-in tools; from Claude's perspective there is no distinction. This provides an extensible architecture for adding new capabilities without modifying Melian's core.

SDK

MCP support uses @modelcontextprotocol/sdk v1.29.0. Servers are configured by path or command in Melian's config and are started as subprocesses on boot.

How Registration Works

On startup, Melian connects to each configured MCP server and fetches its tool list. Those tools are merged into the global tool registry alongside built-in tools. When Claude invokes an MCP tool, Melian proxies the call to the appropriate server over stdio or HTTP and returns the result.

Boot
  └── for each MCP server in config
        └── spawn subprocess (stdio) or connect (http)
        └── fetch tool list via MCP protocol
        └── register tools in global registry

Tool call (from Claude)
  └── lookup tool in registry
        ├── built-in → call handler directly
        └── MCP tool → proxy call to MCP server → return result

Server Configuration

export interface McpServerConfig {
  type: "stdio" | "http";       // transport type (required)
  command?: string;              // executable path or shell command (for stdio)
  args?: string[];
  env?: Record<string, string>;
  url?: string;                  // server URL (for http)
}

Server names are map keys, not a field on the config object.

Adding an MCP Server

Add an entry to the servers map (Record<string, McpServerConfig>) in Melian's config file. The server will be started and its tools registered on the next restart. No code changes are required. Both stdio and HTTP transports are supported.

{
  "servers": {
    "my-tool-server": {
      "type": "stdio",
      "command": "/path/to/mcp-server",
      "args": ["--port", "8080"]
    },
    "remote-server": {
      "type": "http",
      "url": "http://localhost:9090/mcp"
    }
  }
}

Notes

  • MCP tools appear in tool listings and are callable in conversations exactly like built-in tools.
  • If an MCP server crashes or fails to start, its tools are omitted from the registry and a warning is logged; Melian continues operating with remaining tools.
  • Tool schemas from MCP servers are validated against the MCP spec on registration.