-
Notifications
You must be signed in to change notification settings - Fork 25
Remote MCP Server Instruction #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,78 @@ The full stack trace might look like this: | |
|
|
||
| Solution: Replace the `uvx` bit of the command with the output of `which uvx`. | ||
|
|
||
| ## Set Up as a Remote Server | ||
| If you prefer to set up this mcp server as a remote server, you can replace [__main__.py](./src/mcp_server_datahub/__main__.py) with the following: | ||
| ``` Python | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any way we can make this simpler? e.g. make something like
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we just copy and paste the code to this main.py file, you can just run |
||
| from datahub.sdk.main_client import DataHubClient | ||
| from mcp_server_datahub.mcp_server import mcp, set_client | ||
| import uvicorn | ||
| from starlette.applications import Starlette | ||
| from starlette.routing import Mount, Host | ||
|
|
||
| app = Starlette( | ||
| debug=True, | ||
| routes=[ | ||
| Mount('/', app=mcp.sse_app()), | ||
| ] | ||
| ) | ||
|
|
||
| def run(): | ||
| """Start the Starlette server""" | ||
| uvicorn.run(app, host="0.0.0.0", port=8000) | ||
|
|
||
| def main() -> None: | ||
| set_client(DataHubClient.from_env()) | ||
| # mcp.run() | ||
| run() # This will start the Starlette server | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
| ``` | ||
|
|
||
| then run | ||
| ``` | ||
| uv run mcp-server-datahub | ||
| ``` | ||
|
|
||
| ### Claude Desktop App | ||
| In your `claude_desktop_config.json` file, use this: | ||
| ``` json | ||
| { | ||
| "mcpServers": { | ||
| "datahub": { | ||
| "command": "npx", | ||
| "args": ["mcp-remote", "http://localhost:8000/sse"], | ||
| "env": { | ||
| "DATAHUB_GMS_URL": "<your-datahub-url>, such as: http://localhost:8080", | ||
| "DATAHUB_GMS_TOKEN": "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### Cursor Desktop App | ||
| In `.cursor/mcp.json`, use the following: | ||
|
|
||
| ``` json | ||
| { | ||
| "mcpServers": { | ||
| "datahub": { | ||
| "command": "npx", | ||
| "args": ["mcp-remote", "http://localhost:8000/sse"], | ||
| "env": { | ||
| "DATAHUB_GMS_URL": "<your-datahub-url>, such as: http://localhost:8080", | ||
| "DATAHUB_GMS_TOKEN": "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ## Developing | ||
|
|
||
| See [DEVELOPING.md](DEVELOPING.md). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.