Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@begelundmuller
Copy link
Contributor

@begelundmuller begelundmuller commented May 22, 2025

Implements an MCP server in the Rill runtime, enabling MCP clients to connect directly to Rill without starting a separate process.

Features:

  • Supports MCP in Rill Developer on http://localhost:9009/mcp/sse
  • Supports MCP for Rill Cloud projects on https://api.rilldata.com/v1/organizations/{org}/projects/{proj}/runtime/mcp/sse
  • Supports public/unauthenticated access to public Rill Cloud projects
  • Supports authenticated access with user tokens to private Rill Cloud projects

Examples:

Claude config for connecting to Rill Developer (must have rill start running in a terminal):

{
    "mcpServers": {
        "rill": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "http://localhost:9009/mcp/sse"
            ]
        }
    }
}

Claude config for connecting to a public Rill Cloud project:

{
    "mcpServers": {
        "rill": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://api.rilldata.com/v1/organizations/demo/projects/rill-github-analytics/runtime/mcp/sse"
            ]
        }
    }
}

Claude config for connecting to a private Rill Cloud project (use rill token issue to get a personal access token):

{
    "mcpServers": {
        "rill": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://api.rilldata.com/v1/organizations/demo/projects/rill-openrtb-prog-ads/runtime/mcp/sse",
                "--header",
                "Authorization:${AUTH_HEADER}"
            ],
            "env": {
                "AUTH_HEADER": "Bearer <Rill access token>"
            }
        }
    }
}

Future work:

  • Implement a unified, multi-project MCP server for Rill Cloud (e.g. api.rilldata.com/v1/mcp)
  • Implement the MCP OAuth flows so you don't need to manually create a personal access token
  • QA, prompt tuning, more endpoints (user management, etc.)

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@begelundmuller begelundmuller self-assigned this May 22, 2025
@avaitla
Copy link

avaitla commented May 22, 2025

Any reason for using SSE vs Streamable HTTP? Streamable HTTP would allow multiple clients to connect, but I haven't had the same luck with SSE, maybe I'm doing something incorrectly.

@begelundmuller
Copy link
Contributor Author

Any reason for using SSE vs Streamable HTTP? Streamable HTTP would allow multiple clients to connect, but I haven't had the same luck with SSE, maybe I'm doing something incorrectly.

The mcp-go library that we're using only just merged Streamable HTTP two days ago. Unfortunately I wasn't able to get it working with Claude Desktop (even the example project didn't work). So we're going with the currently released SSE implementation for now, but definitely want to switch to the Streamable HTTP implementation when it gets a bit more stable.

@avaitla
Copy link

avaitla commented May 23, 2025

Gotcha, do you think this will be available on rill cloud or just for rill developer? If on rill cloud would be curious if this MCP will support multiple clients (claude desktop from different users) simultaneously?

@begelundmuller
Copy link
Contributor Author

begelundmuller commented May 23, 2025

Gotcha, do you think this will be available on rill cloud or just for rill developer? If on rill cloud would be curious if this MCP will support multiple clients (claude desktop from different users) simultaneously?

Yeah this will also be availability in Rill Cloud (see the third example Claude config in the PR note). And yeah it will support concurrent users/clients! Each user will authenticate with their own access token (initially you'll have to create it manually with this new CLI command, but we also plan on adding support for the OAuth redirect flows later).

@begelundmuller begelundmuller requested a review from k-anshul May 24, 2025 15:44
@begelundmuller begelundmuller marked this pull request as ready for review May 24, 2025 15:44
Copy link
Collaborator

@nishantmonu51 nishantmonu51 left a comment

Choose a reason for hiding this comment

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

👍

@begelundmuller begelundmuller merged commit 546f21b into main May 26, 2025
11 of 12 checks passed
@begelundmuller begelundmuller deleted the begelundmuller/runtime-mcp-server branch May 26, 2025 11:47
begelundmuller added a commit that referenced this pull request May 26, 2025
* Serve MCP from the runtime

* MCP instructions

* Implement all endpoints

* Support dynamic instances + observability middleware

* Support SSE and anonymous users in the runtime proxy

* Update e2e test for GitHub Analytics example project

* Review comments

* Review comment

* Standards compliant JSON schema for metrics view query

* Review prompts

* More prompt tuning

---------

Co-authored-by: Eric P Green <[email protected]>
@begelundmuller begelundmuller mentioned this pull request May 26, 2025
8 tasks
@avaitla
Copy link

avaitla commented May 26, 2025

Do you think the mcp will ever support the ability to generate a rill url the end user can go to as partial evidence of the answer? My concern is it will spit out some numbers but it's really hard to say whether that is right or wrong, being able to corroborate it with a rill dashboard helps check the answer is correct but also continue to answer in the rill ui for the human operator.

@ericpgreen2 ericpgreen2 mentioned this pull request May 27, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants