{"_id":"@agentdiscuss/mcp-server","_rev":"2-3174f60bf78830350d0ecbcac1e8d91d","name":"@agentdiscuss/mcp-server","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@agentdiscuss/mcp-server","version":"0.1.0","keywords":["agentdiscuss","mcp","model-context-protocol","agentic-api","stdio"],"license":"MIT","_id":"@agentdiscuss/mcp-server@0.1.0","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"bin":{"agentdiscuss":"dist/index.js"},"dist":{"shasum":"c3b61c17282833ec020dffbb51bf635911e0bdf7","tarball":"https://registry.npmjs.org/@agentdiscuss/mcp-server/-/mcp-server-0.1.0.tgz","fileCount":75,"integrity":"sha512-LhquUXYWfvpPpKlslQVX5lM4rLfJqeYEITjz2kuqGYd/G/4oAc+w862mbn6F/5hJ2cgJRAL9ir5eTevFE5G/fQ==","signatures":[{"sig":"MEUCICiQRq7trcXThE75Id7h26cjPPRM4YWFLgE4yQwZpFt7AiEAg1Cv0xyPHqQDgGGQMqC9fma47O6g4jnnp0gJv874Sl0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":185295},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"4ca74b4813bf788dceb0cf6ed9cafb6b67a32e89","scripts":{"build":"rm -rf dist && tsc -p tsconfig.json","check":"tsc --noEmit -p tsconfig.json","smoke":"npm run build && node --test test/smoke.test.mjs","start":"node dist/index.js http","dev:mcp":"tsx watch src/index.ts","dev:http":"tsx watch src/index.ts http","start:mcp":"node dist/index.js","start:http":"node dist/index.js http"},"_npmUser":{"name":"iamleoooo","email":"leo@pageonelab.com"},"_npmVersion":"10.8.2","description":"Local stdio fallback package for AgentDiscuss MCP","directories":{},"_nodeVersion":"20.19.2","dependencies":{"zod":"^4.3.6","dotenv":"^17.4.2","express":"^5.2.1","@modelcontextprotocol/sdk":"^1.29.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^6.0.2","@types/node":"^25.6.0","@types/express":"^5.0.6"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server_0.1.0_1776290647997_0.816890780906534","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentdiscuss/mcp-server","version":"0.1.1","description":"Local stdio fallback package for AgentDiscuss MCP","type":"module","bin":{"agentdiscuss":"dist/index.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"build":"rm -rf dist && tsc -p tsconfig.json","check":"tsc --noEmit -p tsconfig.json","dev:http":"tsx watch src/index.ts http","dev:mcp":"tsx watch src/index.ts","smoke":"npm run build && node --test test/smoke.test.mjs","start":"node dist/index.js http","start:http":"node dist/index.js http","start:mcp":"node dist/index.js"},"keywords":["agentdiscuss","mcp","model-context-protocol","agentic-api","stdio"],"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","dotenv":"^17.4.2","express":"^5.2.1","zod":"^4.3.6"},"devDependencies":{"@types/express":"^5.0.6","@types/node":"^25.6.0","tsx":"^4.21.0","typescript":"^6.0.2"},"_id":"@agentdiscuss/mcp-server@0.1.1","gitHead":"de1d9d722de1c824c555887a79865c98a257377f","_nodeVersion":"20.19.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Zz9mqUWEaZQsqApJDHSk9GEPp+92YwnKbb74hOmQd1I376e6i7zxrORsRIXa+cz2bUJpbIYCo2UuGdNN7rV0wA==","shasum":"789f3a75d24c3f2bd21900abe24a8f6bce79cb36","tarball":"https://registry.npmjs.org/@agentdiscuss/mcp-server/-/mcp-server-0.1.1.tgz","fileCount":75,"unpackedSize":185462,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGBugLxbFSdyk4jQst8mzzn46uAaYCV9r+F3TXroeeGpAiB0BRU5VyLivjlH/jYOLgBK8xZ2km+EpFqlj4L5ml7C/w=="}]},"_npmUser":{"name":"iamleoooo","email":"leo@pageonelab.com"},"directories":{},"maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server_0.1.1_1776290947264_0.8207994406329182"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-15T22:04:07.882Z","modified":"2026-04-15T22:09:07.534Z","0.1.0":"2026-04-15T22:04:08.132Z","0.1.1":"2026-04-15T22:09:07.418Z"},"license":"MIT","keywords":["agentdiscuss","mcp","model-context-protocol","agentic-api","stdio"],"description":"Local stdio fallback package for AgentDiscuss MCP","maintainers":[{"name":"iamleoooo","email":"leo@pageonelab.com"}],"readme":"# AgentDiscuss MCP Local Fallback\n\n`@agentdiscuss/mcp-server` is the local stdio fallback package for AgentDiscuss MCP.\n\nThe canonical hosted install is the real remote MCP endpoint at `https://mcp.agentdiscuss.com`.\n\nThis package exists for clients that still need local stdio execution with `AGENTIC_API_KEY`. It does not implement business logic, provider routing, recommendation ranking, pricing, or payment logic locally. It translates MCP tool calls into upstream Agentic API requests and also exposes a lightweight local HTTP helper for debugging the package.\n\n## What This Repo Contains\n\n- An MCP server packaged for local stdio execution via `npx`\n- A lightweight HTTP server for local helper and manifest inspection\n- A reusable Agentic API client\n- Static fallback config for domains and capabilities when discovery endpoints are unavailable\n- A simple HTML landing page for local debugging\n\n## Install Flow\n\nPrimary hosted install:\n\n```bash\nnpx add-mcp https://mcp.agentdiscuss.com\n```\n\nLocal stdio fallback:\n\n```bash\nnpx -y @agentdiscuss/mcp-server\n```\n\nDeprecated compatibility package:\n\n```bash\n@agentrouter/mcp-server\n```\n\nPublish the new package first, then deprecate the old package name on npm.\n\nDuring local install or first run, configure `AGENTIC_API_KEY` when prompted.\n\nGet your API key from:\n\n`https://www.agentdiscuss.com/agentic-api/install`\n\n## Environment Variables\n\nSupported environment variables:\n\n```bash\nAGENTIC_API_BASE_URL=https://api.agentdiscuss.com/api/agentic-api\nAGENTIC_API_KEY=aak_...\nPORT=8787\nNODE_ENV=development\n```\n\nFallback `.env` example:\n\n```bash\ncp .env.example .env\n```\n\n## MCP Tools\n\nThe MCP surface is backend-driven and capability-first:\n\n- The package calls the Agentic API backend to fetch domains, capabilities, and per-capability contracts.\n- Explicit tools such as `search_answer_recommend` or `web_extract_execute` are generated from that backend catalog.\n- Current explicit tools are dynamic. Inspect them through `list_capability_tools` or through your MCP client's tool list instead of expecting a fixed README catalog.\n- The generic router tools remain available as fallback when you already know the domain and capability id.\n\nCore discovery and fallback tools:\n\n| Tool | Purpose | Upstream mapping |\n| --- | --- | --- |\n| `list_domains` | List supported domains | `GET /domains` or local fallback |\n| `list_capability_tools` | List explicit generated MCP tools for one domain or capability | generated from `GET /products/capabilities` |\n| `get_capability_contract` | Fetch required/optional fields and request examples for one capability | `GET /domains/{domain}/capabilities/{capability}/contract` |\n| `recommend_capability_route` | Generic recommend fallback | `POST /domains/{domain}/capabilities/{capability}/recommend` |\n| `execute_capability` | Generic execute fallback | `POST /domains/{domain}/capabilities/{capability}/execute` |\n\nExample explicit tool calls generated from the backend catalog:\n\n```json\n{\n  \"tool\": \"search_answer_recommend\",\n  \"arguments\": {\n    \"query\": \"What changed in AI infrastructure this week?\",\n    \"optimizationPreferences\": [\"quality\", \"speed\"]\n  }\n}\n```\n\n```json\n{\n  \"tool\": \"web_extract_execute\",\n  \"arguments\": {\n    \"url\": \"https://example.com/docs\",\n    \"fields\": [\"title\", \"pricing\", \"authentication\"]\n  }\n}\n```\n\nExample `recommend_capability_route` input:\n\n```json\n{\n  \"domain\": \"email\",\n  \"capabilityId\": \"send\",\n  \"input\": {\n    \"agentName\": \"alpha_agent\",\n    \"optimizationPreferences\": [\"cost\", \"quality\"],\n    \"sender\": {\n      \"mode\": \"platform_managed\",\n      \"replyTo\": \"ops@example.com\"\n    }\n  }\n}\n```\n\nExample `execute_capability` input:\n\n```json\n{\n  \"domain\": \"email\",\n  \"capabilityId\": \"send\",\n  \"input\": {\n      \"to\": \"maya@example.com\",\n      \"subject\": \"Hello from AgentDiscuss\",\n      \"html\": \"<p>Hello</p>\",\n      \"provider\": \"resend\",\n      \"allowFallback\": true\n  }\n}\n```\n\nExample `get_capability_contract` input:\n\n```json\n{\n  \"domain\": \"email\",\n  \"capabilityId\": \"send\"\n}\n```\n\n## Thin Adapter Contract\n\nThis repo is intentionally not the AgentDiscuss business logic layer.\n\nIt does not:\n\n- rank providers locally\n- implement route recommendation logic\n- implement provider selection logic\n- duplicate pricing or wallet logic\n- duplicate settlement logic\n\nIt does:\n\n- normalize MCP tool inputs into upstream HTTP requests\n- surface upstream responses cleanly\n- return structured upstream errors\n- expose discovery endpoints with static fallback\n\n## HTTP Service\n\nThe lightweight HTTP service provides:\n\n- `GET /`\n  - human-readable install and overview page\n- `GET /health`\n  - basic health JSON\n- `GET /manifest`\n  - placeholder manifest for the local stdio fallback package\n- `GET /api/domains`\n  - helper endpoint for all domains\n- `GET /api/capabilities`\n  - helper endpoint for capabilities across all domains\n- `GET /api/domains/:domain/capabilities`\n  - helper endpoint for one domain capability list\n- `GET /api/domains/:domain/capabilities/:capability/contract`\n  - helper endpoint for one capability contract\n\n## Local Development\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nType-check and build:\n\n```bash\nnpm run check\nnpm run build\n```\n\nRun the HTTP service locally:\n\n```bash\nnpm run dev:http\n```\n\nRun the MCP server locally over stdio:\n\n```bash\nnpm run dev:mcp\n```\n\nRun the smoke test:\n\n```bash\nnpm run smoke\n```\n\nProduction-style start commands:\n\n```bash\nnpm run start:http\nnpm run start:mcp\n```\n\n## API Key Configuration\n\nThe MCP server expects API-key-based authentication for upstream Agentic API execution.\n\nRecommended approach:\n\n1. Get an API key from `https://www.agentdiscuss.com/agentic-api/install`\n2. Let your MCP client prompt for `AGENTIC_API_KEY` during install\n3. Optionally keep `AGENTIC_API_KEY` in local environment variables for direct local runs\n\nIf `AGENTIC_API_KEY` is missing:\n\n- discovery endpoints may still work through public upstream discovery or local fallback config\n- authenticated `recommend_capability_route` and `execute_capability` calls will fail fast with a structured configuration error\n\n## Local Testing\n\nFor normal local backend testing:\n\n1. `cp .env.example .env`\n2. set `AGENTIC_API_KEY`\n3. run `npm install`\n4. run `npm run build`\n5. run `npm run start:http`\n6. open `http://127.0.0.1:8787`\n\nUseful local checks:\n\n```bash\ncurl http://127.0.0.1:8787/health\ncurl http://127.0.0.1:8787/manifest\ncurl http://127.0.0.1:8787/api/domains\ncurl http://127.0.0.1:8787/api/capabilities\ncurl http://127.0.0.1:8787/api/domains/email/capabilities/send/contract\n```\n\nFor local MCP testing:\n\n```bash\nnpm run build\nnpx @modelcontextprotocol/inspector node dist/index.js\n```\n\nOr point another MCP client at:\n\n```text\ncommand: node\nargs: [\"<absolute-path>/dist/index.js\"]\nenv:\n  AGENTIC_API_KEY=...\n  AGENTIC_API_BASE_URL=https://api.agentdiscuss.com/api/agentic-api\n```\n\nThe included smoke test covers:\n\n- HTTP landing page and manifest\n- helper JSON endpoints\n- MCP stdio startup\n- MCP tool listing\n- MCP tool input examples in exported schemas\n- capability contract discovery over HTTP and MCP\n- MCP param forwarding from tool args into upstream HTTP requests\n- fallback discovery when upstream is unavailable\n\n## Static Fallback Behavior\n\nThis repo prefers upstream discovery first:\n\n- `GET /domains`\n- `GET /domains/{domain}/capabilities`\n- `GET /products/capabilities`\n\nIf those calls fail, the repo falls back to static config in:\n\n- `src/config/domains.ts`\n- `src/config/capabilities.ts`\n\nThose fallback files are intentionally extensible and include TODO notes where API-driven discovery should replace local config.\n\n## Capability Contracts\n\nThe upstream Agentic API now exposes per-capability contract discovery at:\n\n- `GET /domains/{domain}/capabilities/{capability}/contract`\n\nThis is what `get_capability_contract` proxies for MCP clients.\n\nCurrent contract coverage:\n\n- `email`, `enrichment`, and `social` return typed request contracts derived from the backend DTO decorators\n- generic domains currently return `contractStatus: \"partial\"` with docs and endpoint discovery, but not full typed field contracts yet\n\nCurrent typed contract payloads include:\n\n- `requiredFields`\n- `optionalFields`\n- `conditionallyRequiredFields`\n- field-level primitive and nested object shape\n- generated request examples from DTO metadata\n\nCurrent limitation:\n\n- curated response examples are not yet embedded in the upstream capability catalog\n\n## Placeholder vs Production-Ready\n\nReasonably production-ready in v0:\n\n- stdio MCP packaging\n- Agentic API client\n- thin tool adapter layer\n- install page\n- helper HTTP endpoints\n- structured error handling\n\nStill placeholder or intentionally provisional:\n\n- `GET /manifest` schema, pending confirmation of exact `add-mcp` expectations\n- static fallback capability catalog, pending fully reliable upstream discovery in every environment\n- local helper HTTP copy beyond the primary hosted MCP/docs URLs\n\n## Recommended Folder Structure\n\n```text\nagentdiscuss-mcp/\n├── .env.example\n├── .gitignore\n├── README.md\n├── package.json\n├── tsconfig.json\n└── src/\n    ├── agentic-api/\n    │   ├── client.ts\n    │   └── types.ts\n    ├── catalog/\n    │   └── discovery.ts\n    ├── config/\n    │   ├── capabilities.ts\n    │   ├── constants.ts\n    │   ├── domains.ts\n    │   └── env.ts\n    ├── http/\n    │   ├── app.ts\n    │   └── routes/\n    │       ├── capabilities.ts\n    │       ├── domains.ts\n    │       ├── health.ts\n    │       ├── manifest.ts\n    │       └── root.ts\n    ├── mcp/\n    │   ├── server.ts\n    │   └── tools/\n    │       ├── execute-capability.ts\n    │       ├── list-all-capabilities.ts\n    │       ├── list-capabilities.ts\n    │       ├── list-domains.ts\n    │       ├── recommend-capability-route.ts\n    │       └── utils.ts\n    └── index.ts\n```\n\n## Notes\n\n- The default CLI mode starts the MCP server over stdio so `npx @agentdiscuss/mcp-server` behaves like a local MCP fallback package should.\n- The HTTP service is started explicitly with the `http` subcommand and is meant for local debugging, not as the canonical hosted MCP endpoint.\n- Research remains marked as pending in fallback config and should not be treated as fully live execution surface until the upstream API confirms it.\n","readmeFilename":"README.md"}