Skip to content

feat(middleware): implement MCP server with 29 tools (#30)#31

Merged
alexey-pelykh merged 1 commit intomainfrom
feat/mcp-server
Feb 26, 2026
Merged

feat(middleware): implement MCP server with 29 tools (#30)#31
alexey-pelykh merged 1 commit intomainfrom
feat/mcp-server

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Implement standalone MCP server exposing 29 RemoteClaw-specific tools to CLI subprocess agents via stdio transport
  • Tools organized into 4 categories: session management (7), channel messaging (10), cron scheduling (7), gateway admin (5)
  • NDJSON-based side effects tracking for sent messages and cron additions
  • Environment variable-based configuration with McpHandlerContext shared across all handlers

New Files

File Purpose
src/middleware/mcp-server.ts Entry point with env-based config + StdioServerTransport
src/middleware/mcp-tools.ts Registration orchestrator for all 29 tools
src/middleware/mcp-handlers/context.ts Shared McpHandlerContext type
src/middleware/mcp-handlers/session.ts 7 session tools + callMcpGateway helper
src/middleware/mcp-handlers/message.ts 10 channel messaging tools
src/middleware/mcp-handlers/cron.ts 7 cron scheduling tools
src/middleware/mcp-handlers/gateway.ts 5 gateway admin tools
src/middleware/mcp-side-effects.ts NDJSON writer/reader for side effects

Test plan

  • 31 tests across 5 test files all pass
  • Type-check (pnpm tsgo) passes clean
  • Lint (pnpm lint) passes clean (0 warnings, 0 errors)
  • Format (pnpm format) passes clean
  • CI build and test jobs pass

Closes #30

🤖 Generated with Claude Code

Add a standalone MCP server that exposes 29 RemoteClaw-specific tools
to CLI subprocess agents via stdio transport. Tools are organized into
four categories: session management (7), channel messaging (10), cron
scheduling (7), and gateway admin (5).

Key components:
- mcp-server.ts: Entry point with env-based configuration
- mcp-handlers/: Tool handlers delegating to gateway via callMcpGateway
- mcp-side-effects.ts: NDJSON writer/reader for tracking sent messages
  and cron additions
- mcp-tools.ts: Registration orchestrator

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@alexey-pelykh alexey-pelykh merged commit 83a4912 into main Feb 26, 2026
2 checks passed
@alexey-pelykh alexey-pelykh deleted the feat/mcp-server branch February 26, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement MCP server with 29 tools

1 participant