Skip to content

[FR] Add MCP Support #100

Open
Open
@christianliebel

Description

@christianliebel

I’ve noticed a growing adoption of the Model Context Protocol (MCP), which has become the de facto standard for agentic AI applications. MCP enables compatible clients to interact with external services, such as conducting web searches, obtaining driving instructions, and navigating websites, among many other functionalities.

Here’s a screenshot of GitHub Copilot in Visual Studio Code, showing tools provided by the Playwright MCP Server. By using natural language input in the Copilot chat box, you can then instruct Copilot to navigate to a certain URL, click a certain button, etc.

Image

Given its very powerful and stateful nature, it may, if at all, only be feasible to implement full MCP support in the Prompt API for extensions. However, work is in progress for stateless communication that could possibly be triggered by websites.

In practice, this means adding additional, external tools to the LLM setup. Here’s an example from smolagents (Source). By using the base_tools, the agent is capable of performing a web search to find a remedy for hangover instead of using its world knowledge.

with ToolCollection.from_mcp(server_parameters, trust_remote_code=True) as tool_collection:
    agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=True)
    agent.run("Please find a remedy for hangover.")

Requires #7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions