SuperAPI AI Directory

cortex

Generates API documentation, typed SDKs, and MCP servers from API specifications and Markdown.

Open website

About this tool

Cortex is an open-source project whose goal is to uniformly convert API specifications and Markdown into typed SDKs, interactive documentation, and MCP servers. Its core philosophy is "Every developer. Every agent.", meaning it serves both developers and AI agents.

Purpose Cortex is used to generate three types of artifacts from API specifications and Markdown: interactive API documentation, typed SDKs, and MCP servers for AI agents. It supports combining OpenAPI, AsyncAPI, GraphQL, Protocol Buffer, OpenRPC, and Markdown sources.

Main capabilities

  • Generate SDKs for TypeScript, Python, Go, Java, Kotlin, Ruby, PHP, C#, Rust, C++, and C.
  • Combine multiple specification files in one generated SDK.
  • Generate HTTP, WebSocket, GraphQL, gRPC, and JSON-RPC clients.
  • Build static HTML documentation with interactive API reference pages.
  • Generate MCP servers with typed tools, embedded specifications, SDK guides, and project documentation for AI agents to use.
  • Add Markdown pages, SDK guides, and all API specifications to the MCP server.
  • Override custom generated output via sparse Eta templates.
  • Publish generated packages and MCP servers to language registries and GitHub repositories.

Usage Environment requirements: Node.js 20 or later, npm 10 or later. Some generated SDKs require the conventional compiler or package manager for the target language. Quick start: after starting the local demo, open http://localhost:3012,按 Press Ctrl+C to stop the server. Open-source hosting: keep Markdown in Git, add cortex.config.yml to the default branch of a public GitHub repository, then run the corresponding commands. The first command publishes a free documentation site at PROJECT.cortexdocs.dev, and the second command connects an AI client to the current documentation via local MCP. Deployment requires repository write permission; MCP uses public read permission and checks for changes before each request. Configuration: cortex init creates cortex.config.yml, and relative paths start from the directory containing that file. primaryColor sets the documentation accent color as a six-digit hexadecimal value. custom_head_html adds trusted HTML to every documentation page, supporting metadata, stylesheets, and analytics scripts; local head assets are stored in the project assets directory and served by Cortex from /assets/*. Cortex does not sanitize this value, so only trusted HTML should be added. Appearance: add ?appearance=dark or ?appearance=light to any documentation URL to choose the initial appearance; this parameter takes precedence over the project theme and the visitor's stored preference. Merge rules: sources using the same language and package_name are merged into one SDK; Cortex rejects duplicate operation names and type names that would cause merge ambiguity.

Use cases

  • API projects that need to generate typed SDKs for multiple languages.
  • Teams that need interactive API reference documentation.
  • Scenarios where AI agents should access project documentation and API specifications via MCP.
  • Scenarios where documentation needs to be built as static HTML and deployed to a static web host.

Limitations

  • The generated MCP server does not call gRPC methods; instead, it exposes Protocol Buffer files as MCP resources for agents to inspect the service contract.
  • The production documentation build command exports documentation as static HTML, CSS, JavaScript, and data files; deploy the output directory to a static web host and configure the host to resolve page URLs such as /docs/quickstart to /docs/quickstart.html. The deployed site does not require Node.js server, and does not need access to the original configuration and specifications; after source changes, a rebuild is required. For local preview, cortex docs serve can be used and supports file watching.
  • The generated package contains a local copy of each configured specification, and embeds the configured Markdown and generated SDK README files as tools.
  • The release workflow publishes @cortex-docs/cli and @cortex-docs/mcp; the CLI tarball contains the internal runtime workspace.
  • Before contributing, read CONTRIBUTING.md and DEVELOPMENT.md; vulnerabilities are reported through the private process in SECURITY.md.
  • Cortex Docs is licensed under the MIT License.