mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
1.8 KiB
1.8 KiB
description, icon
| description | icon |
|---|---|
| MCP-style transport in app/src/lib/mcp/ — JSON-RPC over Socket.io. | network-wired |
MCP-style transport (app/src/lib/mcp/)
What this is
The app/src/lib/mcp/ folder provides shared utilities for structured, JSON-RPC–style messages over Socket.io: types, transport, validation, rate limiting, and error handling.
It does not currently ship a large telegram/tools/ tree or dozens of hand-written Telegram MCP tools. Agent tooling is provided through:
- The skills runtime in the Rust core (
openhumanbinary, QuickJS skills), and - Backend/agent integration that lists tools via realtime sync (
tool:syncand related flows — see../ARCHITECTURE.md).
Layout
app/src/lib/mcp/
├── index.ts # Public exports
├── types.ts # Shared interfaces
├── transport.ts # Socket.io JSON-RPC transport helpers
├── validation.ts # Input validation helpers
├── rateLimiter.ts
├── errorHandler.ts
├── logger.ts
└── __tests__/ # Vitest unit tests
Transport (transport.ts)
Used to send/receive JSON-RPC 2.0–style payloads over the existing Socket.io connection (timeouts, pending request maps, etc.). Exact method names and prefixes depend on the server contract; align changes with the backend and the Rust core.
Types (types.ts)
Shared TypeScript types for tools and MCP messages. Keep these aligned with whatever the socket server and core emit.
Testing
Vitest tests live next to the code under __tests__/. Run from the repo root:
pnpm --filter openhuman-app test
See also
- High-level MCP + AI flow:
../ARCHITECTURE.md(AI & tool protocol) - Socket layer: Services (
socketService)