burr icon indicating copy to clipboard operation
burr copied to clipboard

How to integrate with MCP server?

Open hezhangjian opened this issue 7 months ago • 6 comments

hezhangjian avatar Jun 05 '25 00:06 hezhangjian

Which way are you thinking about it? How to use an MCP client within Burr? Or expose a Burr application as a tool to be used?

skrawcz avatar Jun 07 '25 06:06 skrawcz

@skrawcz Thanks for your reply, I am thinking about How to use an MCP client within Burr?

hezhangjian avatar Jun 07 '25 23:06 hezhangjian

@zilto did you have some prototype code for this?

skrawcz avatar Jun 08 '25 14:06 skrawcz

Hi! I don't have prototype code to share, but I think there's two main ways to think about it:

  1. Using Burr behind an MCP "endpoint" (tool, resource, prompt)
  2. Using Burr to model the full server

Burr behind an endpoint

Let's say you have a Burr application that browses the web and generates a summary of the information found. This would be a graph with several nodes.

You could register the full graph behind the tool summarize/ on your MCP server. Calling the tool would launch the Burr Application.run()

Burr to model the MCP server

You can run the MCP server inside Burr (advanced). With Burr's state tracking ability, you can persist and resume the server across sessions. It allow dynamic pattern like registering and unregistering MCP "endpoints".

zilto avatar Jun 16 '25 06:06 zilto

Hi! I don't have prototype code to share, but I think there's two main ways to think about it:

  1. Using Burr behind an MCP "endpoint" (tool, resource, prompt)
  2. Using Burr to model the full server

Burr behind an endpoint

Let's say you have a Burr application that browses the web and generates a summary of the information found. This would be a graph with several nodes.

You could register the full graph behind the tool summarize/ on your MCP server. Calling the tool would launch the Burr Application.run()

Burr to model the MCP server

You can run the MCP server inside Burr (advanced). With Burr's state tracking ability, you can persist and resume the server across sessions. It allow dynamic pattern like registering and unregistering MCP "endpoints".

ah okay thanks @zilto . I think @hezhangjian just wants an example of connecting to an MCP server within Burr.

skrawcz avatar Jun 16 '25 14:06 skrawcz

Apparently, LLM API providers now accept MCP urls as part of their requests (example).

This would allow for a pattern like

@action(...)
def search_issues_on_github(state, ...):
   github_mcp_url = ...
   prompt = ...
   response = openai_client.create(
      model="gpt",
      messages=[{"role": "user", "content": prompt}],
      tools=[        {
            "type": "mcp",
            "server_label": "github_mcp",
            "server_url": github_mcp_url,
            "require_approval": "never",
        } ]
   )

@action(...)
def fix_code(state, ...):
  ...

zilto avatar Jun 25 '25 14:06 zilto