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 YAML or JSON files
  • 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 YAML or JSON file
  • 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

uvx openapi-slice-mcp

The server runs using the STDIO transport and can be integrated with any MCP client.

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.1.0.tar.gz (5.2 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.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openapi_slice_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for openapi_slice_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b72ac698eec5da6cd90684cff7f0724b5cbedb78eef7ca19493750606e71b48f
MD5 c0a69c94315d542a380053f1b211c0f6
BLAKE2b-256 1c1d472d86c4bcd8c001f4e34e12e94bb484417ba33f7b846994f6cfbbdb9553

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for openapi_slice_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c430bd29e0fece53733dcca038d96a34576dda169113aeda263701c563d7cb3f
MD5 a74038dd84c1d02e1dc05c1b3d2f731f
BLAKE2b-256 cfa8e684b9f423581581c34b338392ea3fbecc26a32db172b661d1d9508ca2d8

See more details on using hashes here.

Provenance

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