{"slug": "live-api-specs-for-coding-agents", "title": "Live API specs for coding agents", "summary": "A developer released docs-mcpserver, an MCP server that serves live OpenAPI specs to coding agents one operation at a time, caching the spec from a running service and updating it in the background. The tool aims to reduce token usage and avoid stale documentation by providing real, current API definitions directly to agents.", "body_md": "An agent writing frontend code has to know the backend's API. It has three options. It can read the backend source and work out from scratch what the service already publishes. It can ask you, which promotes you to API documentation. Or it can swallow the entire OpenAPI document in order to use one route out of it.\n\nThen it does the same thing again tomorrow, against a stale `swagger.json`\n\nyou exported last week.\n\n`docs-mcpserver`\n\ntakes the spec straight from the running service, caches it, and serves it one operation at a time.\n\n```\n{\n  \"cacheDir\": \"./cache\",\n  \"libraries\": [\n    {\n      \"name\": \"orders-api\",\n      \"description\": \"Order handling service\",\n      \"sources\": [\n        {\n          \"type\": \"url\",\n          \"origin\": \"https://localhost:5001/openapi/v1.json\",\n          \"kind\": \"schema\",\n          \"name\": \"orders\"\n        }\n      ]\n    }\n  ]\n}\nnpm install -g docs-mcpserver\nclaude mcp add docs -- docs-mcpserver --config /path/to/dev-docs.json\n```\n\nThat is the whole setup.\n\nThe agent lists the definitions in `orders`\n\n, picks the one it needs, and fetches that. For an OpenAPI document the path operations are exposed as definitions named `GET /orders/{id}`\n\n, so it can also search by keyword.\n\nA few hundred tokens for the operation it is writing against, instead of the entire document. That keeps working as the service grows, which a pasted spec does not.\n\nEvery call is answered from the cached spec, never from the network. The fetch happens on startup and then in the background while you work, so an endpoint you added 20 seconds ago is already visible.\n\nStart the backend once, shut it down, and keep building the frontend. The agent still has real routes and real payload shapes. If the service is down, or answers with something that is not a spec, the last known-good copy keeps being served.\n\nCode and issues: [github.com/jgauffin/dev-docs-mcp](https://github.com/jgauffin/dev-docs-mcp). On npm as `docs-mcpserver`\n\n.", "url": "https://wpnews.pro/news/live-api-specs-for-coding-agents", "canonical_source": "https://dev.to/jgauffin/live-api-specs-for-coding-agents-2dcm", "published_at": "2026-08-30 12:33:00+00:00", "updated_at": "2026-08-30 12:52:42.944619+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["docs-mcpserver", "jgauffin", "OpenAPI", "MCP"], "alternates": {"html": "https://wpnews.pro/news/live-api-specs-for-coding-agents", "markdown": "https://wpnews.pro/news/live-api-specs-for-coding-agents.md", "text": "https://wpnews.pro/news/live-api-specs-for-coding-agents.txt", "jsonld": "https://wpnews.pro/news/live-api-specs-for-coding-agents.jsonld"}}