AI agents

Use Cosyte with AI agents.

Our command-line tool, @cosyte/cli, includes an MCP server, so an agent can parse, validate, inspect, and convert healthcare messages with the same code the terminal runs. This page shows how to register it, what it does with your data, and where an agent finds the rest of what we publish.

The MCP server

cosyte-mcp, in @cosyte/cli

The Model Context Protocol (MCP) is how an AI agent’s client, such as a coding assistant, calls tools. cosyte-mcp is an MCP server that runs on your machine, as a local subprocess your client starts and talks to over standard input and output. It is not a hosted service.

About the Model Context Protocol

Register it in your MCP client’s configuration:

MCP client configurationjson
{
  "mcpServers": {
    "cosyte": { "command": "npx", "args": ["-y", "--package", "@cosyte/cli", "cosyte-mcp"] }
  }
}
  • The --package flag is required. The shorter ["-y", "@cosyte/cli", "mcp"] does not work: it fails with "could not determine executable to run", because the package ships two executables, cosyte and cosyte-mcp, and npx has to be told which one to run.
  • Versions 0.0.1 and 0.0.2 of @cosyte/cli are on npm but cannot be installed, so this registration fails on them. Every later version installs.
  • Where @cosyte/cli is already installed, cosyte mcp starts the same server.

Its four tools

Each tool calls the same command the terminal runs, so an agent and a person at the terminal get the same result.

parse

Detects the format from the content, or takes the one you name, and returns the parsed message as typed JSON with value-free warnings.

validate

Parses, then runs the validation of the library that owns the format. A message that parses but is invalid is a successful call that reports the verdict, not a tool error.

inspect

Returns a structural summary with no field values in it: type and classification codes, and structural counts.

convert

Converts an HL7 v2 message to a FHIR R4 Bundle through @cosyte/transform. The command adds no mapping of its own.

Every tool publishes an outputSchema, so a client can check a result against a declared contract. Each result carries ok, a status of success, verdict, or failed, the exit code, a stable code on a failure, and the tool’s own payload under data.

Your data

What the server does with your data

  • It runs locally. npx downloads @cosyte/cli from the npm registry to run it; the messages you parse go to that subprocess on your machine and back to your client. Nothing is sent to us.
  • A tool error carries only value-free diagnostics: a stable code and a position, never a value from your input.
  • There is no --unsafe-show-values option on the agent surface. In the terminal, that flag is the one opt-in way to see an excerpt of the input in a diagnostic; through MCP it cannot be turned on.
  • A tool result carries the data you asked for. Whatever you parse reaches your agent, and the model behind it, in that result.

Synthetic data only

Give an agent synthetic data, never real patient data.

Point an agent at synthetic messages and fixtures. A tool result goes to the agent and the model behind it, and that is not a place for protected health information.

@cosyte/synth generates deterministic synthetic fixtures for this, in six formats (HL7 v2, FHIR R4, C-CDA, X12, NCPDP, and ASTM; not DICOM or MLLP), with no real patient data in them.

When the work needs real data, it belongs under a signed agreement, not in an agent session. We sign Business Associate Agreements.

Read the @cosyte/synth docsTalk to us

Machine-readable files

The files an agent reads first

Plain text in the llms.txt format, so an agent does not have to crawl HTML to learn what we publish.

  • cosyte.com/llms.txtA map of this site: every page worth reading, one line each, with what the page is for, and a link to the documentation’s own map.
  • cosyte.com/llms-full.txtThe full text of every page that llms.txt lists, in one file, each page preceded by its URL. It is written from the pages themselves every time the site is built.
  • docs.cosyte.com/llms.txtThe map of the developer documentation: one entry per package, linking its guides and API reference.

Agent skills

Skills that teach an agent the libraries

cosyte/agent-skills on GitHub

cosyte/agent-skills is a public, MIT-licensed repository of Agent Skills for the @cosyte packages: one SKILL.md per package, and one that picks the right package for a task. Each skill gives the install line, a checked example with synthetic data, the key API names, the package’s limits and known defects, and how to handle protected health information.

It also ships Cursor project rules and an AGENTS.md routing summary. In Claude Code, it installs as a plugin:

Claude Code
claude plugin marketplace add cosyte/agent-skills
claude plugin install cosyte@cosyte

The README gives the install for Claude Code, OpenAI Codex, and Cursor, each method taken from that tool’s own documentation. It says that an install has not yet been run in every tool, and asks for an issue if one does not work as written.

The libraries

Every library installs by its npm name.

The @cosyte/* libraries are MIT-licensed TypeScript packages on npm: one for each standard, and the libraries that build on them. Each installs with one line.

What each library doesThe standards, one page each

npm
npm install @cosyte/hl7
npm install @cosyte/mllp
npm install @cosyte/dicom
npm install @cosyte/x12
npm install @cosyte/ccda
npm install @cosyte/ncpdp
npm install @cosyte/astm
npm install @cosyte/fhir
npm install @cosyte/transform
npm install @cosyte/terminology
npm install @cosyte/cli
npm install @cosyte/deid
npm install @cosyte/synth
npm install @cosyte/dates