> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tool Runner • AI Agent SDK

> MCPToolRunner: A dedicated thread for running MCP operations.

# MCPToolRunner

> Defined in the [**MCP**](../modules/mcp) module.

<Badge color="blue">AI Agent</Badge>

A dedicated thread for running MCP operations.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: MCPToolRunner"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Constructor

<ParamField query="server_params" type="Any" required={true}>
  No description available.
</ParamField>

<ParamField query="timeout" type="Any" required={false} default="60">
  No description available.
</ParamField>

## Methods

<CardGroup cols={2}>
  <Card title="run()" icon="function" href="../functions/MCPToolRunner-run">
    Main thread function that processes MCP requests.
  </Card>

  <Card title="call_tool()" icon="function" href="../functions/MCPToolRunner-call_tool">
    Call an MCP tool and wait for the result.
  </Card>

  <Card title="shutdown()" icon="function" href="../functions/MCPToolRunner-shutdown">
    Signal the thread to shut down.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/mcp/mcp.py#L24">
  `praisonaiagents/mcp/mcp.py` at line 24
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Tools Concept" icon="wrench" href="/docs/concepts/tools" />

  <Card title="Create Custom Tools" icon="plus" href="/docs/guides/tools/create-custom-tools" />

  <Card title="Tool Development" icon="code" href="/docs/tutorials/advanced-tool-development" />

  <Card title="MCP Concept" icon="server" href="/docs/concepts/mcp" />

  <Card title="MCP Lifecycle" icon="rotate" href="/docs/features/mcp-lifecycle" />
</CardGroup>
