Skip to content

MCP External Library Callback Support #755

Open
@xorroproprop

Description

@xorroproprop

There currently doesn't seem to be a way for handling potential callbacks from 3rd party libraries. I found that using thread locking allowed the callback function to execute. However, I think there could be a more "graceful" way of handling this.

`python
from foo import func
from mcp.server.fastmcp import FastMCP

def cb_func()
print(bar)

@mcp.tool(name="callback_foo")
def callback():
foo = func(file_path, cb_func)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions