OpenAPI AnyApi

OpenAPI AnyApi

Scalable MCP server for semantic OpenAPI endpoint discovery and API requests.

74
Stars
16
Forks
1
Releases

Overview

An MCP server that enables semantic discovery and execution of OpenAPI endpoints using in-memory embeddings and FAISS indexing. It consumes a remote OpenAPI JSON document (OPENAPI_JSON_DOCS_URL) and builds an endpoint-centric index where each endpoint (path + method) is stored as its own chunk with parameter-aware embeddings and response schema context. A fast, asynchronous FastAPI server exposes tools named by MCP_API_PREFIX (default "any_openapi"), such as {prefix}_api_request_schema to retrieve endpoint details and {prefix}_make_request to perform API requests. The server supports an optional GLOBAL_TOOL_PROMPT to influence tool descriptions for NLP agents and can be deployed in multi-instance configurations to serve multiple API ecosystems. Endpoints can be queried using natural language; the internal pipeline is: query -> Embedding -> FAISS TopK -> OpenAPI docs -> MCP Client -> construct and execute request. It emphasizes in-memory speed, with endpoint-based chunking to handle large specs while preserving context, and requires no local OpenAPI file access. This design is intended to work with Claude Desktop workflows and supports configurable tool namespaces for flexible integration.

Details

Owner
baryhuang
Language
Python
License
MIT License
Updated
2025-12-07

Features

Endpoint-centric OpenAPI processing

Indexes individual endpoints (path + method) as unique units with parameter-aware embeddings and response context, enabling precise retrieval of endpoint docs as chunks.

In-memory FAISS-based semantic search

Uses FAISS to perform fast nearest-neighbor search over in-memory embeddings for instant endpoint discovery from natural language queries.

Remote OpenAPI source and in-memory indexing

Consumes a remote OpenAPI JSON document via OPENAPI_JSON_DOCS_URL; no local file system access and no frequent API changes required.

Optimized spec handling and chunking

Handles large specs (100KB+; up to tens of MB) with endpoint-centric chunking, lazy loading, and parallel parsing to maintain performance and context.

FastAPI-based asynchronous server

Built on an async FastAPI server with MCP protocol support and tool registration/invocation handling.

Configurable tool namespace and prompt

Supports MCP_API_PREFIX to customize tool namespace and an optional GLOBAL_TOOL_PROMPT to steer tool descriptions for NLP agents.

Claude Desktop integration and multi-instance support

Designed for Claude Desktop workflows with multi-instance deployment capabilities to run multiple MCP servers with separate settings.

Audience

Claude Desktop usersDiscover and call endpoints from private OpenAPI specs via semantic search and tools in Claude Desktop.
API developersIntegrate semantic endpoint discovery for large OpenAPI docs; expose endpoints as MCP tools for programmatic calls.

Tags

OpenAPIMCPsemantic-searchembeddingFAISSin-memoryFastAPIClaudeendpoint-discoveryAPI-requestdockermultisiteconfigurable-namespace