MCP Protocol Explained for Geometry Tools


The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data sources. Instead of building custom integrations for every tool an agent needs, MCP provides a universal interface: the agent discovers available tools, reads their schemas, and calls them — all through a single protocol.

Caliper is built as an MCP server. This post explains what MCP is, how it works at the protocol level, and why it is a natural fit for geometry tool services.

The problem MCP solves

Before MCP, giving an AI agent access to an external tool meant writing bespoke integration code. Every tool had its own API format, authentication method, and error handling. If you wanted your agent to use five tools, you wrote five integrations.

This does not scale. Agent developers spend more time on plumbing than on reasoning logic. And tool developers have no standard way to make their services agent-accessible — each consumer needs a custom adapter.

MCP standardizes this. A tool developer publishes an MCP server. An agent developer points their MCP client at the server’s endpoint. The client discovers what tools are available, what parameters they accept, and calls them using a consistent JSON-RPC protocol.

How MCP works

MCP uses JSON-RPC 2.0 over a transport layer (typically HTTP with Server-Sent Events, or stdio for local tools). The protocol has three core phases:

1. Initialization

The client connects to the server and exchanges capabilities:

// Client → Server
{
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-03-26",
    "clientInfo": { "name": "my-agent", "version": "1.0" }
  },
  "id": 1
}

The server responds with its name, version, and what it supports (tools, resources, prompts).

2. Tool discovery

The client asks what tools are available:

// Client → Server
{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "id": 2
}

The server returns a list of tools with their names, descriptions, and JSON Schema input definitions. For Caliper, this includes:

  • caliper_detect_format — Detect the format of a geometry file (free)
  • caliper_stl_stats — Extract metadata from STL files
  • caliper_obj_stats — Extract metadata from OBJ files
  • caliper_ply_stats — Extract metadata from PLY files
  • caliper_pcd_stats — Extract metadata from PCD point clouds
  • caliper_las_stats — Extract metadata from LAS/LAZ point clouds
  • caliper_gltf_stats — Extract metadata from glTF/GLB scene files
  • caliper_auto_stats — Detect format and extract metadata in one call

Each tool schema specifies the input parameters. For example, caliper_auto_stats accepts either file_url (a URL to fetch the file from) or file_base64 (the file content encoded as base64).

3. Tool invocation

The client calls a tool:

// Client → Server
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "caliper_auto_stats",
    "arguments": {
      "file_url": "https://example.com/model.stl"
    }
  },
  "id": 3
}

The server processes the request and returns structured content:

{
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"format\":\"stl_binary\",\"vertices\":1206,\"triangles\":2400,...}"
      }
    ]
  },
  "id": 3
}

The agent receives structured JSON metadata it can reason about directly — no parsing HTML, no scraping, no guessing at response formats.

Why MCP fits geometry tools

Geometry file analysis is a natural MCP use case for several reasons:

Agents cannot parse binary formats natively. An LLM has no built-in ability to read STL, PLY, or glTF binary data. It needs an external tool. MCP provides the standard interface for that tool.

The interaction is stateless and request-response. Each Caliper call is independent: send a file, get metadata back. There is no session state to manage, no multi-step workflow, no streaming partial results. This maps cleanly to MCP’s tool-call model.

Tool discovery lets agents self-configure. An agent connecting to Caliper for the first time does not need hardcoded knowledge of what tools exist. It calls tools/list, reads the schemas, and knows what it can do. If Caliper adds STEP support tomorrow, the agent discovers it automatically on the next connection.

Schema-driven inputs reduce errors. Because each tool has a JSON Schema definition, the agent (or its framework) can validate parameters before sending the request. This eliminates a class of integration bugs where the wrong field name or type causes silent failures.

MCP vs. plain REST

Caliper also has a REST API — the same tools are available at https://caliper.fit/tools/{tool_name} via plain HTTP POST. So why use MCP?

AspectRESTMCP
DiscoveryRead docs, hardcode endpointsAutomatic via tools/list
SchemaOpenAPI spec (if published)Built into the protocol response
Agent integrationCustom HTTP client code per toolZero-code: point MCP client at endpoint
Multi-tool agentsN integrations for N toolsOne MCP client for all MCP servers
Error handlingHTTP status codes, varies by APIStandardized JSON-RPC error objects

For a single tool in a script, REST is simpler. For an agent that uses many tools — a geometry analyzer, a web searcher, a code executor, a database connector — MCP eliminates per-tool integration work.

Connecting to Caliper via MCP

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "caliper": {
      "url": "https://caliper.fit/mcp/"
    }
  }
}

Restart Claude Desktop. Caliper’s tools appear in the tool list automatically.

Cursor

In Cursor settings, add an MCP server with the URL https://caliper.fit/mcp/. The tools become available in Cursor’s agent mode.

Programmatic clients

Any MCP SDK works. Here is a Python example using the mcp package:

from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def analyze_file(url: str):
    async with streamablehttp_client("https://caliper.fit/mcp/") as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            result = await session.call_tool(
                "caliper_auto_stats",
                {"file_url": url}
            )
            return result.content[0].text

The bigger picture

MCP is still early, but the direction is clear: agents will use many tools, and the integration cost per tool needs to approach zero. Caliper is designed for this world — a focused geometry service that any MCP-compatible agent can pick up and use without custom code.

If you are building an agent that handles files — CAD review, asset pipelines, manufacturing QA, GIS data processing — adding geometry awareness is one MCP endpoint away:

https://caliper.fit/mcp/