How to integrate with MCP server?
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 Thanks for your reply, I am thinking about How to use an MCP client within Burr?
@zilto did you have some prototype code for this?
Hi! I don't have prototype code to share, but I think there's two main ways to think about it:
- Using Burr behind an MCP "endpoint" (tool, resource, prompt)
- 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".
Hi! I don't have prototype code to share, but I think there's two main ways to think about it:
- Using Burr behind an MCP "endpoint" (tool, resource, prompt)
- 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 BurrApplication.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.
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, ...):
...