MCP server starter: give AI agents secure access to internal systems

We use this starter when an agent needs access to internal systems such as a CRM, an ERP or a document store. It gives you a Model Context Protocol server with sign-in, scoped permissions and a record of every call from the first commit.

What's inside.

How it fits together.

  1. 01

    Connect

    An MCP client, such as an agent or a desktop assistant, connects over streamable HTTP and completes the OAuth flow with your identity provider.

  2. 02

    Authorise

    On each tool call the server validates the token, resolves the user and checks the scope the tool requires.

  3. 03

    Execute

    The tool calls the internal system through a small client that carries the user's context, with rate limits and timeouts applied.

  4. 04

    Record

    The call is written to the audit log, and a typed result goes back to the agent.

A look at the code.

A read-only tool with a typed result, a scope check and an audit entry.

Python
from mcp.server.fastmcp import Context, FastMCP
from pydantic import BaseModel

from app.audit import audit_log
from app.auth import require_scope
from app.crm import crm_client

mcp = FastMCP("internal-systems")

class Customer(BaseModel):
    id: str
    name: str
    plan: str
    open_tickets: int

@mcp.tool()
async def get_customer(customer_id: str, ctx: Context) -> Customer:
    """Look up a customer by id. Read-only, requires the crm:read scope."""
    user = require_scope(ctx, "crm:read")
    record = await crm_client.get_customer(customer_id, on_behalf_of=user.id)
    await audit_log(user_id=user.id, tool="get_customer", args={"customer_id": customer_id})
    return Customer(**record)

if __name__ == "__main__":
    mcp.run(transport="streamable-http")

Built with.

All technologies

Hear when it is public.

We are preparing the mcp server starter for release. One email when it is out, and our occasional notes.

Occasional emails, unsubscribe any time. See our privacy policy.

Start working with Vantion.