Diamra Developer Docs
All pages

MCP

One MCP server gives your coding agent what it needs to work with Diamra. Add it once. Today the agent reads these docs through it, a guide with the rules to follow, and skills such as page design for your brand. What comes later arrives on the same address, so you never add a second server.

MCP serverhttps://mcp.diamra.com/v1/mcp

The server speaks MCP over Streamable HTTP. It never takes an API key. The docs and the skills need no sign-in. A tool that works for your Diamra account asks you to sign in first.

Connect your agent

Any MCP client that connects to a remote server can use it. Give the client the address above.

In Claude, open Connectors, choose Add custom connector, and paste the address. In Claude Code, run one command:

Claude CodeShell
claude mcp add --transport http diamra https://mcp.diamra.com/v1/mcp

Then ask a question that needs the docs, such as "Using Diamra, how do I verify a webhook signature?" The agent finds the pages on its own.

Sign in

Two tools work for your Diamra account: get_profile and sign_out. The tools that come later for your store will ask for the same sign-in. The first time your agent calls one, the server answers that you must sign in, and your client opens a page on diamra.com.

  1. The page names the app that asks, the address it sends you back to, and the Diamra account that answers. If you are signed out of Diamra, the page asks you to sign in first.
  2. Read the three lines. Choose Allow only if you started this yourself, from an app you trust. Deny stops it, and Use another account lets you switch.
  3. The app gets a token for your account and goes back to your agent. A token lasts an hour, and the app renews it on its own.

An app you allow can see your account and do what you can do on Diamra, in your stores too. It never sees your password. Sign-in is separate from API keys: your server still calls the API with its own key.

In Claude Code, type /mcp, choose diamra, then choose to authenticate. Your browser opens the page, and the app shows there as Claude Code (diamra). You can also sign in from a shell with one command:

Claude CodeShell
claude mcp login diamra

To disconnect an app, ask your agent: "Sign me out of Diamra." It calls sign_out, and Diamra takes back what you allowed for that app. The next tool that works for your account asks you to sign in again.

Tools

ToolWhat it does
list_docs
Lists every page of these docs by name.
read_doc
Returns one page as Markdown. Its page is a name from list_docs, such as api/designs or guide.
list_skills
Lists the skills, and says when the agent reads each one.
read_skill
Returns a skill as Markdown: its core, or one part of it, such as typography. Its skill is a name from list_skills, such as luxury-page-design.
get_profile
Answers the Diamra account you signed in with: its id, email and name. Needs sign-in.
sign_out
Signs the app out of your Diamra account. Needs sign-in.
ping
Answers ok. Use it to check the connection.

The pages are the ones you read here. When a page changes on this site, your agent reads the new text within ten minutes.

Skills

A skill is a working method the agent follows for one kind of task. The server tells the agent when to read each one, so you do not have to ask for it.

SkillWhat the agent does with it
luxury-page-design
Designs and builds pages for your brand. It asks you about the brand first, and keeps a design system in your project, in a folder named design, that it fills in as the work goes on. Every later session reads that folder first, so the site stays consistent. It has a part for each aspect: typography, color, space and layout, shape and radius, elevation and shadows, motion, Phosphor icons, imagery and components.

The agent reads the core of a skill first, then only the parts the task needs. After the first session your project has a design folder with the brand, the rules, the tokens, the components and a log of decisions. It also adds a short note to the agent instructions of your project, so any agent you use later starts from the same decisions.

Examples

You ask in your own words, and the agent picks the pages. These are the pages it usually reads.

  • "How do I verify a webhook signature?" The agent reads guide, then webhooks/signing-keys.
  • "Add sign-up and log-in for my customers." The agent reads guide, api/keys and api/auth.
  • "Show a customer designs from what they describe." The agent reads guide and api/designs.
  • "Tell my page when a customer accepts a price." The agent reads guide, embed/listen and embed/messages.
  • "Design a landing page for our engagement rings." The agent reads the skill luxury-page-design, asks you about your brand, then builds the page.
  • "Who am I signed in as on Diamra?" The agent calls get_profile. If you have not signed in yet, your client asks you to sign in first.

One session, step by step

  1. The agent connects. The server tells it to read the page guide first.
  2. It calls list_docs and gets the name of every page.
  3. It calls read_doc for guide, then for each page your question needs.
  4. It answers you, or writes the code, from what it read.

One call by hand

Your agent makes these calls for you. To see one, send it yourself: every tool call is one POST. This one reads the Health page.

RequestShell
curl https://mcp.diamra.com/v1/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{    "jsonrpc": "2.0",    "id": 1,    "method": "tools/call",    "params": { "name": "read_doc", "arguments": { "page": "api/health" } }  }'
AnswerJSON
{  "jsonrpc": "2.0",  "id": 1,  "result": {    "content": [      { "type": "text", "text": "# Health\n\nTells you whether the API is up. It needs no key and is never billed..." }    ],    "structuredContent": {      "page": "api/health",      "title": "Health",      "url": "https://diamra.com/developer/docs/api/health",      "markdown": "# Health\n\nTells you whether the API is up. It needs no key and is never billed..."    },    "isError": false  }}

The text is the page as Markdown, and structuredContent carries the same page with its name, title and address. A name that is not in list_docs answers with isError set, and tells the agent what to do next:

Answer for an unknown pageJSON
{  "jsonrpc": "2.0",  "id": 2,  "result": {    "content": [{ "type": "text", "text": "Unknown page: api/orders. Call list_docs for the pages." }],    "isError": true  }}

Sign-in for your own client

Claude Code handles the sign-in for you, and so does any client that follows the MCP specification. If you write your own MCP client, the server follows the authorization part of that specification: OAuth 2.1 with PKCE, and a client registers itself.

  • tools/list marks every tool with securitySchemes: noauth for a public tool, oauth2 for a tool that needs sign-in. A public tool takes no token.
  • A tool that needs sign-in, called with no token, answers 401. Its WWW-Authenticate header points to the server metadata.
  • The metadata names the authorization server. Your client registers there, sends the person to sign in, and gets an access token and a refresh token.
  • Send the access token in the Authorization header of each call: Bearer and the token.
  • A token that has expired, or that the person took back, answers 401 again, with error="invalid_token" in the header. Renew the token, or start the sign-in again.
Request with no tokenShell
curl -i https://mcp.diamra.com/v1/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{    "jsonrpc": "2.0",    "id": 1,    "method": "tools/call",    "params": { "name": "get_profile", "arguments": {} }  }'
AnswerHTTP
HTTP/2 401www-authenticate: Bearer resource_metadata="https://mcp.diamra.com/.well-known/oauth-protected-resource/v1/mcp"content-type: application/json{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32001, "message": "Sign in to Diamra to use this tool." } }

What the agent reads first

When the agent connects, the server tells it to read the guide for agents before it writes code. The guide is a short list of rules: where a key lives, which headers a call takes, how to wait for a design, and how to check a webhook.

In this part