Skip to main content
Agent MCP lets you connect to a deployed agent from your own code and call its tools — ask questions, retrieve cited resources, and trigger sync/deploy. This page includes a utility script to explore and interact with the Model Context Protocol (MCP) tools an agent exposes.
Get your agent’s MCP URL and Access Token from its Integration & Sharing → Integration tab. See Agents and the MCP overview.

Features

  • List Tools: Dynamically fetch and display all available tools, their descriptions, and input schemas.
  • Call Tools: Invoke specific tools with custom JSON arguments via the command line.
  • Environment Support: Securely load your MCP URL and Authorization Token from a .env file.

Setup

  1. Clone or copy the files to your project directory.
  2. Create a virtual environment (recommended):
  3. Install dependencies:
  4. Configure Environment Variables: Copy the example environment file and fill in your credentials:
    Open .env and set your MCP_URL and MCP_TOKEN.

Quick Start Example

Explore MCP tools programmatically using Python:
explore_mcp_tools.py

Usage

List Available Tools

To see all tools supported by the agent:

Call a Specific Tool

To execute a tool, provide its name and a JSON string for the arguments:

Override Configuration

You can also pass the URL and Token directly via CLI arguments:

Detailed Tool Examples

Here are examples of how to call each available tool using the CLI:

1. Query

Ask a question to the agent:

2. Get Resource Download URL

Get URLs for specific resource IDs (usually obtained from citations in a query result):

3. Get Resources

Inquire about specific file paths:

4. Sync Agent Workflow

Trigger a synchronization of the agent’s workflow to pick up the latest data:

5. Deploy Agent

Deploy the agent to apply the latest changes/data:

Available MCP Tools

Use --list (shown above) to fetch the live tool list and input schemas directly from your agent.