Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Set Up as a Remote Server
## Advanced: 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 mcp-server-datahub serve --port <my port> just work?

Copy link
Author

Choose a reason for hiding this comment

The 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 mcp-server-datahub serve --port <my port>
But I am not clear the overall direction for deploying this as a remote server , I wrote this instruction just in case someone wants to use it for some PoC.

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).