How to implement an MCPHUB based on FastMCP in FastAPI? #1376
Unanswered
gao-xiangyang
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It coincides with the functions of this open-source project, https://github.com/samanhappy/mcphub, but it is implemented in Node.js.
A complete project built on FastAPI, featuring a core module MCPHUB. This module serves as a management hub between users and MCP services (e.g., dbhub), primarily responsible for user-level permission management and traffic control.
Core Functions of the MCPHUB Module
Isolation of access permissions for multiple databases: Databases connected via MCP (e.g., dbhub) are only accessible to authorized users, restricting access for unauthorized users.
Granular operation-based permission restrictions: Dangerous operations (such as the delete function) can be disabled for specific users to mitigate data risks.
Service-level access restrictions: Supports full prohibition of MCP service usage for certain users, ensuring strict control over underlying resources.
(Implied by the description, it can be supplemented: Restricting traffic from user access to MCP services to prevent resource overload caused by excessive requests.)
Module Positioning
MCPHUB acts as a "gateway layer" in the project, governing interactions between users and MCP services. Through refined permission and traffic management, it ensures the secure, controlled, and stable operation of multi-database resources.
I have a database table that records all my MCPs, and assuming they are all SSE services, how should I use FastMCP as a proxy? And it needs to be integrated into my FastAPI project.

My challenge is how to easily implement this functionality using FastMCP!
Beta Was this translation helpful? Give feedback.
All reactions