MCP server that extracts relevant portions of OpenAPI specs for specific endpoints, reducing context size when working with large API specifications
Project description
OpenAPI Slice MCP Server
An MCP (Model Context Protocol) server that helps you work with large OpenAPI specifications by extracting only the relevant portions for specific endpoints. This is particularly useful when working with LLMs that have context limitations - instead of loading an entire large OpenAPI spec, you can extract just the parts you need for a specific endpoint.
Features
- Endpoint-specific extraction: Get minimal OpenAPI specs containing only the requested endpoint and its dependencies
- Automatic dependency resolution: Recursively finds and includes all referenced components (schemas, parameters, etc.)
- Multiple formats: Output in YAML or JSON format
- File support: Load OpenAPI specs from local YAML or JSON files
- Remote support: Fetch OpenAPI specs directly from URLs (HTTP/HTTPS)
- Discovery tools: List all available endpoints in a loaded specification
Tools
The server provides the following MCP tools:
load_openapi_spec(file_path: str)- Load an OpenAPI specification from a local YAML or JSON fileload_openapi_spec_from_url(url: str, timeout: int = 30)- Load an OpenAPI specification from a remote URLlist_endpoints()- List all available endpoints in the currently loaded specificationextract_endpoint_slice(path: str, method: str, output_format: str = "yaml")- Extract a minimal spec slice for a specific endpointget_server_status()- Get the current status of the server
Usage
Running the Server
Stdio Mode (Default)
For local development and Claude Desktop integration:
uvx openapi-slice-mcp
The server runs using the STDIO transport and can be integrated with any MCP client.
HTTP Mode
For Smithery deployment or remote access:
# Using the dedicated HTTP entry point (runs on port 8000 by default)
uvx openapi-slice-mcp-http
# Or using the main entry point with --transport flag
uvx openapi-slice-mcp --transport http --host 0.0.0.0 --port 8000
The HTTP server exposes the MCP protocol at http://host:port/mcp.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openapi_slice_mcp-0.2.0.tar.gz.
File metadata
- Download URL: openapi_slice_mcp-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52cb2735f4a53cde96074da690f3ac9b9da9d8714ee7dcd30e84bdf7f10ed111
|
|
| MD5 |
8b4c968ae654d4bc018f694284dcc5a5
|
|
| BLAKE2b-256 |
b8ac54dce2e8f0994937fb588085dffd9d55c8c823c0d3c279e4ec38293f2077
|
Provenance
The following attestation bundles were made for openapi_slice_mcp-0.2.0.tar.gz:
Publisher:
publish.yml on vvarp/openapi-slice-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openapi_slice_mcp-0.2.0.tar.gz -
Subject digest:
52cb2735f4a53cde96074da690f3ac9b9da9d8714ee7dcd30e84bdf7f10ed111 - Sigstore transparency entry: 635967460
- Sigstore integration time:
-
Permalink:
vvarp/openapi-slice-mcp@a669f8bf20465741a0fb1b2e5920dfd5e7bc58ac -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/vvarp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a669f8bf20465741a0fb1b2e5920dfd5e7bc58ac -
Trigger Event:
release
-
Statement type:
File details
Details for the file openapi_slice_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: openapi_slice_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f820f70028def226fb7aa55dd65dc2f6202185b19d4588dfea915db0daa328a8
|
|
| MD5 |
c84a4f9bc28ca3c4c8092302d34176fc
|
|
| BLAKE2b-256 |
adb8a8c2d0cd414774bba39869afa58ed451496c7c68cbdc62f74b5f4c98e3a4
|
Provenance
The following attestation bundles were made for openapi_slice_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on vvarp/openapi-slice-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openapi_slice_mcp-0.2.0-py3-none-any.whl -
Subject digest:
f820f70028def226fb7aa55dd65dc2f6202185b19d4588dfea915db0daa328a8 - Sigstore transparency entry: 635967497
- Sigstore integration time:
-
Permalink:
vvarp/openapi-slice-mcp@a669f8bf20465741a0fb1b2e5920dfd5e7bc58ac -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/vvarp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a669f8bf20465741a0fb1b2e5920dfd5e7bc58ac -
Trigger Event:
release
-
Statement type: