Skip to content

feat(mcp): Add OpenAPI MCP server POC#1113

Draft
andmatei wants to merge 5 commits intomainfrom
poc-foas-mcp
Draft

feat(mcp): Add OpenAPI MCP server POC#1113
andmatei wants to merge 5 commits intomainfrom
poc-foas-mcp

Conversation

@andmatei
Copy link
Collaborator

@andmatei andmatei commented Jan 28, 2026

Summary

This PR adds a Model Context Protocol (MCP) server POC for the FOAS CLI that enables AI agents to load, filter, and explore OpenAPI specifications.

Features

Tools

  • load_spec - Load an OpenAPI spec from disk
  • filter_spec - Filter a spec by tags, operation IDs, or paths
  • export_spec - Save a spec to disk (JSON or YAML)
  • unload_spec - Remove a spec from memory
  • list_specs - List all loaded specs

Resources

List Resources:

  • openapi://{alias}/operations - List all operations
  • openapi://{alias}/tags - List all tags
  • openapi://{alias}/paths - List all paths
  • openapi://{alias}/schemas - List all schemas

Detail Resources:

  • openapi://{alias}/operations/{operationId} - Get operation details
  • openapi://{alias}/tags/{tagName} - Get operations for a tag
  • openapi://{alias}/paths/{path} - Get operations for a path
  • openapi://{alias}/schemas/{schemaName} - Get schema definition

Usage

Build

cd tools/cli
make build-mcp

Configure with Augment

{
  "mcpServers": {
    "openapi": {
      "command": "/path/to/openapi-mcp"
    }
  }
}

Implementation Details

  • Uses the official MCP Go SDK (github.com/modelcontextprotocol/go-sdk)
  • Reuses existing slice.Slice() for filtering
  • Reuses existing openapi.Save() for export
  • In-memory registry with max 50 specs
  • Full test coverage (25 tests)

Files Changed

  • tools/cli/cmd/mcp/main.go - Entry point
  • tools/cli/internal/mcp/registry/ - Spec storage
  • tools/cli/internal/mcp/tools/ - MCP tools
  • tools/cli/internal/mcp/resources/ - MCP resources
  • tools/cli/Makefile - Build targets

Pull Request opened by Augment Code with guidance from the PR author

dependabot bot and others added 5 commits January 20, 2026 12:25
Bumps [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) from 3.964.0 to 3.968.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.968.0/clients/client-s3)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-s3"
  dependency-version: 3.968.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Add a Model Context Protocol (MCP) server for the FOAS CLI that enables
AI agents to load, filter, and explore OpenAPI specifications.

Features:
- Tools: load_spec, filter_spec, export_spec, unload_spec, list_specs
- Resources: /operations, /tags, /paths, /schemas (list and detail)
- In-memory registry for loaded specs (max 50)
- Reuses existing filter/slice functionality

Build with: make build-mcp
Binary: ./bin/openapi-mcp
@andmatei andmatei requested a review from a team as a code owner January 28, 2026 12:30
@andmatei andmatei marked this pull request as draft January 28, 2026 12:30
@andreaangiolillo andreaangiolillo removed their request for review February 13, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments