|
11 | 11 |
|
12 | 12 | [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open standard protocol that allows AI Models to connect with external systems, tools, and data sources. A common problem that enterprises face while using MCP servers is that there is a need for a central point of access to a curated list of MCP servers and a catalog of such servers. This is the precise problem that this application provides a solution for by implementing an **MCP Gateway & Registry**. |
13 | 13 |
|
| 14 | +**<u>Demo Video</u>**: [https://www.youtube.com/watch?v=o_Wich7AChk](https://www.youtube.com/watch?v=o_Wich7AChk) |
14 | 15 |
|
15 | 16 | ## Architecture |
16 | 17 |
|
@@ -124,7 +125,7 @@ flowchart TB |
124 | 125 |
|
125 | 126 | ## Prerequisites |
126 | 127 |
|
127 | | -* An Amazon EC2 machine for running this solution. |
| 128 | +* An Amazon EC2 machine with a standard Ubuntu AMI for running this solution. |
128 | 129 | * An SSL cert for securing the communication to the Gateway. _This Gateway uses a self-signed cert by default and is also available over HTTP_. |
129 | 130 | * One of the example MCP servers packaged in this repo uses the [`Polygon`](https://polygon.io/stocks) API for stock ticker data. Get an API key from [here](https://polygon.io/dashboard/signup?redirect=%2Fdashboard%2Fkeys). The server will still start without the API key but you will get a 401 Unauthorized error when using the tools provided by this server. |
130 | 131 |
|
@@ -197,7 +198,16 @@ The Gateway and the Registry are available as a Docker container. The package in |
197 | 198 |
|
198 | 199 | 1. **Navigate to [`http://localhost:7860`](http://localhost:7860) access the Registry** |
199 | 200 |
|
200 | | -  |
| 201 | +  |
| 202 | + |
| 203 | +1. **View logs from the Registry and the built-in MCP servers:** |
| 204 | + Logs are available on the local machine in the `/var/log/mcp-gateway` directory. |
| 205 | + ``` |
| 206 | + tail -f /var/log/mcp-gateway/* |
| 207 | + ``` |
| 208 | +
|
| 209 | +1. **View MCP server metadata:** |
| 210 | + Metadata about all MCP servers connected to the Registry is available in `/opt/mcp-gateway/servers` directory. The metadata includes information gathered from `ListTools` as well as information provided while registering the server. |
201 | 211 |
|
202 | 212 | ### Running the Gateway over HTTPS |
203 | 213 |
|
@@ -225,12 +235,35 @@ The Gateway and the Registry are available as a Docker container. The package in |
225 | 235 | ## Usage |
226 | 236 |
|
227 | 237 | 1. **Login:** Use the `ADMIN_USER` and `ADMIN_PASSWORD` specified while starting the Gateway container. |
228 | | -3. **Manage Services:** |
| 238 | +1. **Manage Services:** |
229 | 239 | * Toggle the Enabled/Disabled switch. The Nginx config automatically comments/uncomments the relevant `location` block. |
230 | 240 | * Click "Modify" to edit service details. |
231 | 241 | * Click the refresh icon (🔄) in the card header to manually trigger a health check and tool list update for enabled services. |
232 | | -4. **View Tools:** Click the tool count icon (🔧) in the card footer to open a modal displaying discovered tools and their schemas for healthy services. |
233 | | -5. **Filter:** Use the sidebar links to filter the displayed services. |
| 242 | +1. **View Tools:** Click the tool count icon (🔧) in the card footer to open a modal displaying discovered tools and their schemas for healthy services. |
| 243 | +1. **Filter:** Use the sidebar links to filter the displayed services. |
| 244 | +
|
| 245 | +### Interact with the MCP Registry via its own built-in MCP server! |
| 246 | +
|
| 247 | +The MCP Registry provides an [API](#api-endpoints-brief-overview), this API is also exposed as an MCP server so we have an MCP Server to manage the MCP Registry itself. You can use any MCP Host such as [`Cursor`](https://www.cursor.com/) or others that support remote MCP Servers over SSE. To add the MCP Registry's MCP server to Cursor, simply add the following JSON to Cursor's `mcp.json` file. |
| 248 | +
|
| 249 | +>Using the MCP Gateway in Agents and hosts such as Cursor does require that you run the Gateway over HTTPS, see instructions [here](#running-the-gateway-over-https). |
| 250 | +
|
| 251 | +```json |
| 252 | +{ |
| 253 | + "mcpServers": { |
| 254 | + "mcpgw": { |
| 255 | + "url": "https://mymcpgateway.mycorp.com//mcpgw/sse" |
| 256 | + } |
| 257 | + } |
| 258 | +} |
| 259 | +``` |
| 260 | + |
| 261 | +Cursor should now be able to talk to the MCP Gateway and you should be able to use the tools it provides. |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | +**To add more MCP servers provided by the Gateway to Cursor and other tools we would need to wait for this [PR 597](https://github.com/modelcontextprotocol/python-sdk/pull/597) on the MCP Python SDK to be merged into the SDK. Please add a +1 to the PR to make sure it makes it into the May 2025 release of the MCP Python SDK**. |
| 266 | + |
234 | 267 |
|
235 | 268 | ### Steps to add a new MCP server to the Gateway and Registry |
236 | 269 |
|
|
0 commit comments