Skip to content

Python: Bug: An error is output when calling an MCP server that was created with the Azure Functions MCP binding. #12949

@sun-ming-fujitsu

Description

@sun-ming-fujitsu

Describe the bug
When initializing the connection of MCPSsePlugin with an MCP server created using the Azure Functions MCP binding, the following error message is output.
However, this error has no impact on actual operation.

Error processing request: '2' for client 'rmiik2e0tennltav'
Microsoft.Azure.Functions.Extensions.Mcp: Method not found.

If I use the following MCP client, the above error message is not displayed.

from mcp import ClientSession
from mcp.client.sse import sse_client
async def main():
    async with sse_client("http://localhost:7071/runtime/webhooks/mcp/sse") as streams:
        async with ClientSession(streams[0], streams[1]) as session:
            await session.initialize()

            tools = await session.list_tools()
            print(tools)


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

To Reproduce
Steps to reproduce the behavior:

  1. Create an MCP server on Azure Functions using the Azure Functions MCP binding (documentation link).
  2. Run the MCP server locally (func start).
  3. Create a script that instantiates a chat_completion_agent using Semantic Kernel and an MCPSsePlugin whose URL points to the above MCP server.
  4. Run the script and check for the error message in the terminal where the MCP server is running.

Expected behavior
There should no error happed when initializing the connection of MCPSsePlugin with a mcp server.

Screenshots

Image

Platform

  • Language: Python
  • Source: pip package version 1.35.0
  • AI model: AzureOpenAI:gpt-4o-global-2024-08-06]
  • IDE: VS Code
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpythonPull requests for the Python Semantic Kerneltriage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions