{"id":47962970,"url":"https://github.com/effectorhq/effector-serve","last_synced_at":"2026-04-04T10:03:36.669Z","repository":{"id":346465333,"uuid":"1190103357","full_name":"effectorHQ/effector-serve","owner":"effectorHQ","description":"Runtime MCP server: typed validation, discovery, composition","archived":false,"fork":false,"pushed_at":"2026-03-24T01:09:47.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T00:57:57.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effectorHQ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-24T01:07:18.000Z","updated_at":"2026-03-24T01:09:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/effectorHQ/effector-serve","commit_stats":null,"previous_names":["effectorhq/effector-serve"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/effectorHQ/effector-serve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectorHQ%2Feffector-serve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectorHQ%2Feffector-serve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectorHQ%2Feffector-serve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectorHQ%2Feffector-serve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effectorHQ","download_url":"https://codeload.github.com/effectorHQ/effector-serve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectorHQ%2Feffector-serve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31395450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T09:13:02.600Z","status":"ssl_error","status_checked_at":"2026-04-04T09:13:01.683Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T10:03:35.878Z","updated_at":"2026-04-04T10:03:36.661Z","avatar_url":"https://github.com/effectorHQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **📦 Consolidated.** This package is now part of [`effectorHQ/effector`](https://github.com/OpenClawHQ/effectorhq) → `packages/serve/`.\n\u003e All active development continues in the monorepo. This repository remains available for reference.\n\u003e\n\u003e Install: `npm install @effectorhq/serve` (published from the monorepo)\n\n---\n\n# @effectorhq/serve\n\n[![Status: Alpha](https://img.shields.io/badge/status-alpha-orange.svg)](#)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)\n[![Tests](https://img.shields.io/badge/tests-37%20passing-brightgreen.svg)](#)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n**Runtime MCP server with typed validation, capability discovery, and composition.**\n\nSource repo: **[effectorHQ/effector-serve](https://github.com/effectorHQ/effector-serve)**. CLI: `effector-serve`.\n\nWraps any skill directory as an MCP server that validates tool I/O against declared types at runtime, lets agents discover capabilities by type signature, and suggests multi-step skill chains.\n\nThree runtime layers — **Typed**, **Composable**, **Verifiable** — built on the [effectorHQ](https://github.com/effectorHQ) toolchain.\n\n---\n\n## Install\n\n```bash\nnpm install @effectorhq/serve\n```\n\nOr run directly:\n\n```bash\nnpx @effectorhq/serve ./my-skills\n```\n\n## Quick Start\n\n### CLI\n\n```bash\n# Start a guarded MCP server (stdin/stdout)\neffector-serve ./skills\n\n# Strict mode — reject calls with type validation errors\neffector-serve ./skills --strict\n\n# Allow tools that require network access\neffector-serve ./skills --allow-network\n\n# Allow both network and subprocess\neffector-serve ./skills --allow-network --allow-subprocess\n```\n\n### Programmatic\n\n```js\nimport { createGuardedServer } from '@effectorhq/serve';\n\nconst server = await createGuardedServer('./skills', {\n  strict: false,        // warn on type errors (default)\n  allowNetwork: true,   // permit network-requiring tools\n  allowSubprocess: false,\n});\n\n// Use handleRequest for testing or embedding\nconst response = server.handleRequest({\n  jsonrpc: '2.0',\n  id: 1,\n  method: 'tools/list',\n});\n\nconsole.log(response.result.tools);\n// → [...your skills..., effector_discover, effector_compose, effector_inspect]\n```\n\n---\n\n## What It Does\n\n```\n┌────────────────┐     ┌──────────────────┐     ┌────────────────┐\n│  Your Skills   │────▶│  effector-serve  │────▶│  MCP Client    │\n│  (SKILL.md +   │     │                  │     │  (Claude, etc) │\n│  effector.toml)│     │  ┌─ Type Guard   │     └────────────────┘\n└────────────────┘     │  ├─ Permissions  │\n                       │  ├─ Discovery    │\n                       │  ├─ Composition  │\n                       │  └─ Telemetry    │\n                       └──────────────────┘\n```\n\n### Without effector-serve\n\nYour MCP server returns skill instructions. The LLM calls tools with whatever arguments it wants. If types don't match, you find out at runtime — or never.\n\n### With effector-serve\n\nEvery `tools/call` is validated against the declared `[effector.interface]` types. Permission violations are caught before execution. Agents can query _\"what skills accept CodeDiff?\"_ and _\"how do I get from CodeDiff to Notification?\"_ at runtime.\n\n---\n\n## Built-in Tools\n\neffector-serve adds three MCP tools alongside your skills:\n\n### `effector_discover`\n\nFind skills by type signature.\n\n```json\n{\n  \"name\": \"effector_discover\",\n  \"arguments\": {\n    \"input_type\": \"CodeDiff\",\n    \"output_type\": \"ReviewReport\"\n  }\n}\n```\n\nReturns matching skills with their interfaces, permissions, and descriptions.\n\n### `effector_compose`\n\nSuggest multi-step skill chains between types.\n\n```json\n{\n  \"name\": \"effector_compose\",\n  \"arguments\": {\n    \"from_type\": \"CodeDiff\",\n    \"to_type\": \"Notification\",\n    \"max_depth\": 3\n  }\n}\n```\n\nUses BFS to find the shortest type-compatible chains. If `code-review` outputs `ReviewReport` and `notify` accepts `Markdown`, and `format-report` bridges them, you get:\n\n```\nCodeDiff → [code-review] → ReviewReport → [format-report] → Markdown → [notify] → Notification\n```\n\n### `effector_inspect`\n\nView a skill's full typed interface.\n\n```json\n{\n  \"name\": \"effector_inspect\",\n  \"arguments\": { \"tool_name\": \"code-review\" }\n}\n```\n\nReturns `interface`, `permissions`, `metadata`, and `inputSchema`.\n\n---\n\n## Runtime Validation\n\n### Type Guards\n\nEvery `tools/call` is checked against the skill's declared `[effector.interface]`:\n\n```toml\n# effector.toml\n[effector.interface]\ninput = \"CodeDiff\"\noutput = \"ReviewReport\"\n```\n\nIf the input is missing required fields for the `CodeDiff` type (e.g., `files`), the server returns a structured error:\n\n```json\n{\n  \"error\": {\n    \"code\": -32602,\n    \"message\": \"Input validation failed: CodeDiff: missing required field: files\",\n    \"data\": {\n      \"code\": \"EFFECTOR_VALIDATION_ERROR\",\n      \"direction\": \"input\",\n      \"typeName\": \"CodeDiff\",\n      \"missingFields\": [\"files\"]\n    }\n  }\n}\n```\n\nIn **permissive mode** (default), validation warnings are recorded via telemetry but the call proceeds. In **strict mode** (`--strict`), validation errors reject the call.\n\n### Permission Enforcement\n\nSkills declare permissions in `effector.toml`:\n\n```toml\n[effector.permissions]\nnetwork = true\nsubprocess = false\n```\n\nBy default, the server blocks tools that require `network` or `subprocess`. Use `--allow-network` / `--allow-subprocess` to permit them.\n\n```json\n{\n  \"error\": {\n    \"code\": -32600,\n    \"message\": \"Permission denied: Tool \\\"deploy\\\" requires network access. Use --allow-network to permit.\",\n    \"data\": { \"code\": \"EFFECTOR_PERMISSION_DENIED\" }\n  }\n}\n```\n\n### Telemetry\n\nAll validation results, tool calls, and permission checks are tracked in an in-memory ring buffer:\n\n```js\nconst stats = server.telemetry.getStats();\n// {\n//   totalEvents: 142,\n//   validationPass: 120,\n//   validationFail: 8,\n//   callCount: 130,\n//   permissionDenied: 2,\n//   byTool: {\n//     \"code-review\": { calls: 45, validationPass: 44, validationFail: 1 },\n//     ...\n//   }\n// }\n```\n\n---\n\n## API Reference\n\n### `@effectorhq/serve`\n\n| Export | Description |\n|--------|-------------|\n| `createGuardedServer(dir, options?)` | Create a guarded MCP server |\n| `startGuardedServer(dir, options?)` | Create and start on stdin/stdout |\n| `createTelemetry(options?)` | Create a standalone telemetry instance |\n| `createPermissionEnforcer(config?)` | Create a standalone permission enforcer |\n| `handleDiscover(args, toolMap)` | Discovery tool handler (for embedding) |\n| `handleCompose(args, toolMap)` | Composition tool handler (for embedding) |\n| `handleInspect(args, toolMap)` | Inspection tool handler (for embedding) |\n\n### `ServeOptions`\n\n```js\n{\n  strict: false,          // Reject on validation errors (default: warn)\n  allowNetwork: false,    // Allow tools with network permission\n  allowSubprocess: false, // Allow tools with subprocess permission\n  telemetry: true,        // Enable telemetry tracking\n}\n```\n\n---\n\n## CLI\n\n```\neffector-serve — Runtime MCP server with typed validation\n\nUsage:\n  effector-serve \u003cskills-dir\u003e [options]\n\nOptions:\n  --strict           Reject tools/call on type validation errors\n  --allow-network    Allow tools that declare network permission\n  --allow-subprocess Allow tools that declare subprocess permission\n  --no-telemetry     Disable telemetry event tracking\n```\n\n---\n\n## Architecture\n\neffector-serve wraps `@effectorhq/skill-mcp` (the existing MCP server) and intercepts `handleRequest`:\n\n```\n                   ┌────────────────────────────────────────┐\n                   │          effector-serve                │\n                   │                                        │\n   stdin ─────────▶│  handleRequest()                       │\n                   │    │                                   │\n                   │    ├─ initialize → identity + caps     │\n                   │    ├─ tools/list → skills + 3 built-in │\n                   │    └─ tools/call                       │\n                   │         │                              │\n                   │         ├─ Permission check            │\n                   │         ├─ Type validation (guard)     │\n                   │         ├─ Telemetry recording         │\n                   │         │                              │\n                   │         ├─ Synthetic tool?             │\n                   │         │   ├─ effector_discover       │\n                   │         │   ├─ effector_compose        │\n                   │         │   └─ effector_inspect        │\n                   │         │                              │\n                   │         └─ Delegate to inner server    │\n                   │              (instruction passthrough) │\n   stdout ◀────────│                                        │\n                   └────────────────────────────────────────┘\n```\n\n### Dependencies\n\nAll `@effectorhq/*` packages, zero external dependencies:\n\n| Package | Used For |\n|---------|----------|\n| `@effectorhq/core` | Type guards, type checker, error types |\n| `@effectorhq/skill-mcp` | Inner MCP server (JSON-RPC 2.0) |\n| `@effectorhq/compose` | BFS composition suggestion |\n| `@effectorhq/types` | Standard type catalog |\n\n---\n\n## Zero External Dependencies\n\nThis package uses only `@effectorhq/*` packages and Node.js built-ins. The `@effectorhq/*` packages themselves have zero external dependencies. The entire dependency tree is:\n\n```\n@effectorhq/serve\n├── @effectorhq/core        (0 deps)\n├── @effectorhq/skill-mcp   (→ @effectorhq/core)\n├── @effectorhq/compose      (→ @effectorhq/core, @effectorhq/types)\n└── @effectorhq/types        (0 deps)\n```\n\nNo supply chain risk. No version conflicts. Fast installs.\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is currently licensed under the [Apache License, Version 2.0](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectorhq%2Feffector-serve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffectorhq%2Feffector-serve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectorhq%2Feffector-serve/lists"}