Skip to main content

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 file
  • load_openapi_spec_from_url(url: str, timeout: int = 30) - Load an OpenAPI specification from a remote URL
  • list_endpoints() - List all available endpoints in the currently loaded specification
  • extract_endpoint_slice(path: str, method: str, output_format: str = "yaml") - Extract a minimal spec slice for a specific endpoint
  • get_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

openapi_slice_mcp-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openapi_slice_mcp-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for openapi_slice_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 52cb2735f4a53cde96074da690f3ac9b9da9d8714ee7dcd30e84bdf7f10ed111
MD5 8b4c968ae654d4bc018f694284dcc5a5
BLAKE2b-256 b8ac54dce2e8f0994937fb588085dffd9d55c8c823c0d3c279e4ec38293f2077

See more details on using hashes here.

Provenance

The following attestation bundles were made for openapi_slice_mcp-0.2.0.tar.gz:

Publisher: publish.yml on vvarp/openapi-slice-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openapi_slice_mcp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openapi_slice_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f820f70028def226fb7aa55dd65dc2f6202185b19d4588dfea915db0daa328a8
MD5 c84a4f9bc28ca3c4c8092302d34176fc
BLAKE2b-256 adb8a8c2d0cd414774bba39869afa58ed451496c7c68cbdc62f74b5f4c98e3a4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page