Skip to content
Cube coverageMH-362,64,583 clusters × 492Pan-India653 districts × 39reference →

Quickstart — OpenAI Agents + MCP

The OpenAI Agents SDK connects to an MCP server directly — it discovers the thirteen tools and their schemas, so you never hand-maintain function descriptors.

from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async with MCPServerStreamableHttp(
    params={"url": "https://api.gridrock.ai/mcp"},
) as gridrock:
    agent = Agent(
        name="locality-analyst",
        instructions=(
            "Use Bharat Strata witnesses. Every value is sourced, dated and "
            "graded; never invent a site score or risk prior."
        ),
        mcp_servers=[gridrock],
    )
    result = await Runner.run(
        agent,
        "Resolve 19.0760, 72.8777 and summarise its witnessed row.",
    )
    print(result.final_output)

The agent calls resolve_locality then read_witnesses on its own; each tool result is a witness envelope carrying its generation and coverage honesty.