MCP Server Framework

Node.js library for building small Model Context Protocol servers, with an HTTP and a stdio transport and a shared registry file.

packages/robos-mcp-lib

robos-mcp-lib is a library first. Other packages (system-mcp, task-manager-mcp, workspace-manager-mcp and several more under packages/) call it to define their tools and resources.

What the library provides

const { createMCPServer, startStdioTransport, listRegisteredServers } = require('../robos-mcp-lib/index');

const server = createMCPServer({
  appId: 'demo',
  tools: [{ name: 'hello', description: 'Say hello', handler: async () => 'hi' }],
  port: 19200,            // optional; omit to skip HTTP
});
  • JSON-RPC 2.0 handling for initialize, ping, tools/list, tools/call, resources/list and resources/read, reporting protocol version 2024-11-05. Any other method returns error -32601.
  • Naming. A tool named hello in app demo becomes robos_demo_hello; names that already start with robos_ are kept. A resource URI such as info becomes robos://demo/info.
  • HTTP transport (startHttp(port) or the port option): POST /mcp for JSON-RPC and GET /health, with permissive CORS headers.
  • stdio transport (startStdioTransport(server)): one JSON request per line on stdin, one response per line on stdout.
  • Registry. When a server starts it writes itself to ~/.config/robos/mcp/servers.json (app id, name, version, port, endpoint, tool names, resource URIs). stop() removes the entry. The MCP Router reads this file.

A tool handler’s return value is sent back as one text block (strings as-is, other values as pretty-printed JSON). If the handler throws, the result has isError: true and the error message.

The inspector window

main.js creates a demo server with the tools calculate_metrics and query_workspace and the resource system-info, and shows them in RobOS MCP Server Inspector & Framework. The tool results are fixed sample values. Click Call calculate_metrics to see the request and response in the protocol trace; Clear Trace empties it. The demo server has no HTTP port. Run it with npm start in packages/robos-mcp-lib (there is no .desktop launcher). npm test runs node --test.

More in Agent Services & MCP Servers

Agent Autoconfig

Writes MCP configuration and instruction files so Claude Code, Gemini, Copilot and Cursor all point at the RobOS MCP router.

Agent Daemon (agentd)

Keeps a registry of sub-agent sessions, each with its own home directory and environment, behind a Unix socket and a small window.

Agent Profile Daemon

Creates short-lived agent profiles with their own home directory (tmpfs when run as root) and runs commands with that home and environment.

Agent Session Library

Node.js client for the agentd socket, plus a small demo window and a simulated test-driven-development runner.

CI Monitor MCP Server

An MCP server that lets agents list Buildkite builds and read failed-job logs, backed by the connection set up in CI Monitor.

Dev Tools MCP Server

An MCP server with a small catalog of developer CLI tools; "install" and "check" read and write a JSON file and do not touch the system.

Engineering Knowledge Graph MCP Server

An MCP server that lets agents search and edit a small node store, query and propose changes to the SDLC graph, and look up schema types.

IDE Bridge MCP Server

An MCP server that forwards IDE commands (open file, breakpoints, run configurations, refactorings) to the RobOS IntelliJ plugin on port 63343.

MCP Router

Single MCP endpoint that lists the tools of the servers in the registry and routes tool calls to them, with built-in fallbacks.

RobOS CLI Tools

Four shell scripts for scripts and agents: send a notification, set the active task, append to the work journal, and emit or read events.

System MCP Server

MCP server with six tools for preferences, notifications, a tool inventory, file-name search and the active task, backed by a JSON file with sample data.

Task Manager MCP Server

MCP server with seven tools for listing, creating and advancing tasks stored in ~/.config/robos/tasks/tasks.json.

Workspace Manager MCP Server

MCP server with six workspace tools, backed by a JSON file of sample workspaces. Several tools return canned results and do not run anything.