A small TypeScript reference for semantic MCP tool surfaces backed by a remote observer API.
This repository is about one specific pattern:
- keep business semantics in one public or semi-public observer surface
- let both internal agents and external MCP clients consume the same contracts
- keep local bridges thin
It is part of a small public code series:
agent-code-playbook-kitfor process IR and compiled runtime playbooksagent-code-runner-sandboxfor bounded execution primitivesagent-code-observer-mcpfor semantic tool surfaces and MCP bridgingagent-code-a2ui-contractsfor structured rich-answer contractsorg-aware-agentsfor the docs-first architecture layer
src/types.ts— observer capabilities and tool typessrc/capabilities.ts— capability normalization helperssrc/remote-observer-client.ts— minimal remote observer clientsrc/stdio-bridge.ts— stdio MCP bridge for a remote observer surfaceexamples/— public-safe capabilities example
Many agent stacks duplicate tool semantics across:
- prompts
- backend APIs
- local wrappers
- MCP adapters
This repository shows a cleaner direction:
- one semantic surface
- thin adapters
- shared tool descriptions for different clients
npm install
npm test
npm run build
npm run demoThe stdio bridge expects:
ANAVI_PUBLIC_API_BASE_URLANAVI_MCP_BEARER_TOKEN- optional
ANAVI_MCP_ORGANIZATION_ID
Run it with:
tsx src/stdio-bridge.ts