Skip to content

User Approval Before Executing MCP Tool in Agent Using mcp_servers #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
Kirchen99 opened this issue Jun 2, 2025 · 0 comments
Open
2 tasks done
Labels
question Question about using the SDK

Comments

@Kirchen99
Copy link

Please read this first

  • Have you read the docs?Agents SDK docs
    I read the SDK documents, but cannot find a way to specify which of the MCP server's tools require approval when I use mcp_servers in the code.
  • Have you searched for related issues? Others may have had similar requests
    I searched with key words "agent mcp", find nothing about "approval"

Question

Currently, the agent configuration using mcp_servers allows MCP tools to be executed automatically. Is there a way to have a feature similar to the require_approval attribute of the HostedMCPTool class for my current agent setup?

async with MCPServerStreamableHttp(
    name="My MCP Server",
    params={
        "url": "http://localhost:9000/mcp"
    },
) as mcp_server:

agent = Agent(
    name="Assistant",
    instructions="Use the tools to help user.",
    mcp_servers=[mcp_server],
    model_settings=ModelSettings(tool_choice="auto"),
)
@Kirchen99 Kirchen99 added the question Question about using the SDK label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

1 participant