Connect the ISMS Copilot MCP server to Pydantic AI

Setup tested on 2026-11-29 with pydantic-ai-slim 2.77.0: the files below listed ISMS Copilot's tools and ran one read call on our test account.

Pydantic AI 2 connects to MCP servers through MCPToolset, which picks the transport from the URL you give it. Add the toolset to an agent and its typed, validated outputs can rest on what ISMS Copilot says a framework requires, which matters when the output is a control mapping or a questionnaire answer someone will sign. The script below uses MCPToolset with a bearer header, list_tools, then direct_call_tool on list_workspaces, no model involved. It is the check we ran.

Who does what

  1. Pydantic AI

    Runs the agent with your model, validates its output against your schema and calls ISMS Copilot when the model needs it.

  2. ISMS Copilot

    Returns the compliance judgement for the field being filled, with the framework requirement it rests on.

  3. You

    Define the schema, set what the agent may call and sign off on what it returns.

The tested setup

  1. 1

    Create a token

    Sign up at chat.ismscopilot.com (free, no card), open Settings, Connected apps, and create a token. The Agent delegation preset grants account:read, workspaces:read, conversations:create, company_context:read and memories:read, with no write scopes. Our own check used a narrower token with five read scopes only (account, workspaces, memories, documents, company context), which is enough for the check below. conversations:create lets your agent ask questions, and each question uses your plan's messages. Copy the pat-isms- value once and keep it in ISMS_COPILOT_TOKEN, never in a committed file.

  2. 2

    Install Pydantic AI with MCP

    In a virtual environment, install the version this page shows. The [mcp] extra brings the client library.

    Install
    pip install "pydantic-ai-slim[mcp]==2.77.0"
  3. 3

    Run the check

    Save the script as check_ismscopilot.py and run it with ISMS_COPILOT_TOKEN set. The async with block opens the connection once for both calls.

    check_ismscopilot.py
    import asyncio, os
    from pydantic_ai.mcp import MCPToolset
    
    ismscopilot = MCPToolset(
        "https://account.ismscopilot.com/v1/account/mcp",
        headers={"Authorization": f"Bearer {os.environ['ISMS_COPILOT_TOKEN']}"},
    )
    
    async def main():
        async with ismscopilot:
            tools = await ismscopilot.list_tools()
            print([t.name for t in tools])
            print(await ismscopilot.direct_call_tool("list_workspaces", {}))
    
    asyncio.run(main())
    

The server URL, if you add it by hand:

https://account.ismscopilot.com/v1/account/mcp

What the test showed

list_tools returned 29 tools, and direct_call_tool on list_workspaces returned the test account's sample workspaces as parsed JSON.

Tested with pydantic-ai-slim 2.77.0, Python 3.12. The token was read-only, on our test account with sample data.

Add the toolset to an agent

Pass the same MCPToolset in the toolsets list of your Agent, then run the agent inside async with agent: so the connection stays open for the whole run. That needs your model provider's key and was not part of our test.

Every tool, the scopes each one needs and the sign-in options: the ISMS Copilot MCP server.

What it does not do

  • Earlier Pydantic AI 1.x code that used MCPServerStreamableHTTP does not run on 2.x; the setup above is for 2.x only.
  • ISMS Copilot works from what your agent sends it, plus the company profile, memories and documents you keep in ISMS Copilot. It does not read your systems on its own.
  • Answers and findings are drafts for a person to decide. ISMS Copilot does not certify anyone; your auditor's judgement stays your auditor's.

If something does not work

  • ImportError for MCPServerStreamableHTTP? That class was removed in Pydantic AI 2; use MCPToolset as above.
  • Tool names clash with another server? Call .prefixed("ismscopilot") on the toolset to give every ISMS Copilot tool a prefix.

Pydantic AI docs: MCP client. Connect an agent with a token, in the ISMS Copilot docs.

Every AI and tool that connects: use ISMS Copilot in your AI. ISMS Copilot in Google ADK. ISMS Copilot in LlamaIndex. ISMS Copilot in Claude Code. Building your own agent? The developer hub.

ISMS Copilot is made by Better ISMS. It is not affiliated with or endorsed by Pydantic. Product names belong to their owners. Agents get a Markdown version of this page by sending Accept: text/markdown.

The GRC expert your agent calls.

Free to start, no card. Create a token, run the check, then give the tools to your agent.