Skip to content

feat: add mcp server (load, unload, export tools + registry)#1202

Merged
yelizhenden-mdb merged 4 commits into
mainfrom
CLOUDP-393141-1
Apr 9, 2026
Merged

feat: add mcp server (load, unload, export tools + registry)#1202
yelizhenden-mdb merged 4 commits into
mainfrom
CLOUDP-393141-1

Conversation

@yelizhenden-mdb

@yelizhenden-mdb yelizhenden-mdb commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Proposed changes

Jira ticket: CLOUDP-393141

Introduces a new MCP server that enables AI agents to manage OpenAPI specifications in memory. Built with the official MCP Go SDK.

Technical design can be found here

Features

Tools

  1. load - Load OpenAPI specs from files into memory

  2. unload - Remove specs from memory by alias

  3. export - Export loaded/virtual specs to JSON or YAML files

Core Components

Registry (internal/registry/)

  • Thread-safe in-memory storage for OpenAPI specs
  • Supports both file-based and virtual specs
  • Collision detection and checksum validation

Tool Handlers (internal/tools/)

  • Type-safe handlers using MCP SDK's typed handler pattern
  • Clean separation: SDK adapters in tools.go, business logic in separate files

FOASCLI Integration (tools/cli/pkg/openapi/)

  • Refactored existing FOASCLI code to export SaveToFile() function
  • Shared OpenAPI processing logic between FOASCLI and MCP server

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

The following components will be introduced in subsequent PRs:

  • Remaining tools
  • Resources
  • Binary generation

@mongodb mongodb deleted a comment from cursor Bot Apr 8, 2026
@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review April 8, 2026 16:07
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner April 8, 2026 16:07

@cveticm cveticm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on mcp side, lgtm!

@andmatei andmatei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM great work!

Comment thread tools/cli/pkg/openapi/openapi.go Outdated
Co-authored-by: Andrei Matei <29061011+andmatei@users.noreply.github.com>
@yelizhenden-mdb yelizhenden-mdb merged commit 0b4fd63 into main Apr 9, 2026
14 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-393141-1 branch April 9, 2026 09:38
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.

3 participants