-
Notifications
You must be signed in to change notification settings - Fork 307
Create MCP proxy from OpenAPI specifications #1561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sternakt
wants to merge
44
commits into
main
Choose a base branch
from
1554-create-mcp-proxy-from-openapi-specifications
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ttps://github.com/ag2ai/ag2 into 1554-create-mcp-proxy-from-openapi-specifications
* WIP * Add operation renaming
…ttps://github.com/ag2ai/ag2 into 1554-create-mcp-proxy-from-openapi-specifications
…ttps://github.com/ag2ai/ag2 into 1554-create-mcp-proxy-from-openapi-specifications
…ttps://github.com/ag2ai/ag2 into 1554-create-mcp-proxy-from-openapi-specifications
… generate-mcp-server-configs
…i/ag2 into generate-mcp-server-configs
Generate mcp server configs
Codecov ReportAttention: Patch coverage is
... and 54 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
We need a tool that automatically generates an stdio-based MCP server from an OpenAPI specification (either through a URL or as a JSON file). This server will connect to the service described in the OpenAPI spec and expose it as an MCP tool. The main goal is to enable easy creation of authenticated MCP tools for any service that has an OpenAPI specification, including the handling of authentication and security mechanisms as specified by the OpenAPI standard.
Key Features & Requirements:
Input:
Output:
Authentication and Security:
MCP Server:
Error Handling:
Environment Variables:
Use Case:
Motivation:
Acceptance Criteria:
Example Code:
The following Python example demonstrates how to generate an MCP server from an OpenAPI specification, authenticate using environment variables, and interact with the API through an LLM agent:
Explanation:
MCPProxy.create():
create_toolkit_and_run():
AssistantAgent
), which can use the MCP tools.Environment Variables:
API_KEY
andOAUTH2_TOKEN
are passed as environment variables to thestdio_client
. The server uses these variables to authenticate with the service.Stdio Connection:
stdio_client
, which communicates with the server through standard input and output.ClientSession
manages the session between the MCP server and the agent.Additional Notes:
API_KEY
,OAUTH2_TOKEN
).requests
orhttpx
, to facilitate communication with the service described in the OpenAPI specification.