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.1.tar.gz (6.4 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.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file openapi_slice_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: openapi_slice_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 6.4 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.1.tar.gz
Algorithm Hash digest
SHA256 575257747e64e7dd3e342fc0b4818fd916e026140f7f1eeb157259e28adc7ea1
MD5 2e63556f241f2126a055d8fdb07de0ce
BLAKE2b-256 3a05699d7decc5e20af7726ca6b1b55316355eb1560ed14761abd4f1c06dc725

See more details on using hashes here.

Provenance

The following attestation bundles were made for openapi_slice_mcp-0.2.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openapi_slice_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e89d5a4908103e6cd467cfb765b603ef1b68fed11c096c40ef37a832dbd6bcc
MD5 e5043d5ac1f2601fb459ac540455250d
BLAKE2b-256 1920b1c5ef92274bea5899f066088f876b694df7f7d44d54097cdd98052505b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openapi_slice_mcp-0.2.1-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