Repository navigation
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
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.
Summary
Adds
hyperforge.mcp_proxy, an MCP proxy for progressive discovery. It sits in front of any number of upstream MCP servers. Instead of combining all of their tools into one long list, it exposes only two tools:search: full-text search over every upstream tool. It returns qualified names (server.tool), descriptions and input schemas.execute: calls a discovered tool by its qualified name withparams.This keeps the agent's tool list and context small no matter how many upstream servers are connected.
Architecture
config.py: PydanticProxyConfig/UpstreamServerConfig. Each upstream sets its transport, its stdio command or HTTP URL, a timeout, include/exclude tool filters and tags. It also accepts the commonmcpServers: {name: {...}}mapping, from YAML or JSON.provider.py: theConfigProviderprotocol, with static and file implementations. This is the extension point for later DB-backed or per-tenant configs.upstream.py: one long-lived client session per upstream. Each session is owned by its own asyncio task, so the MCP client's anyio cancel scopes are entered and exited in the same task. A failed upstream does not stop the proxy. Its error is recorded and shown asunavailable_servers.index.py: an in-memory BM25F-style index. Fields are weighted (tool name > server/tags > description > params > server description). It also uses camelCase/snake_case tokenization and simple suffix stemming. An empty query lists tools.proxy.py:MCPProxyhandles the lifecycle (start/stop/reload, async context manager), builds the index, and runssearchandexecute. If a tool name is unknown, it raisesToolNotFoundwith search-based suggestions.server.py/app.py/commands.py: wrap the proxy as a low-level MCPServer, served over stdio or stateless streamable HTTP (with/health/ready). They are exposed through the newhyperforge-mcp-proxyentry point. Settings use theMCP_PROXY_environment prefix.Other changes
pyyamldependency.hyperforge/examples/mcp_proxy: an opencode setup that proxies a local FastMCP inventory server,server-everythingandserver-filesystem, plus a smoke-test client.node_modulesis gitignored.hyperforge/tests/mcp_proxy: config, proxy and end-to-end tests against real stdio fixture servers.Notes / follow-ups
tools/list_changednotifications are not handled yet; usereload().