Skip to content

Model Context Protocol Server

The Model Context Protocol (MCP)1 is an open standard that lets Artificial Intelligence (AI) assistants call external tools. The Mat3ra MCP server exposes the platform through this standard, so that an assistant such as Claude Code, Cursor or Visual Studio Code can find a material, set up a simulation job, submit it and read its results on behalf of the user.

The server is hosted by Mat3ra at the address below. No installation is required: an MCP client and a Mat3ra account are sufficient.

1
https://mcp.mat3ra.com/mcp

1. Capabilities

The tools below are available at the time of writing. The server itself is the authority on the current list, which every MCP client retrieves when it connects.

Tool Description Sign-in
get_material Returns a material from Standata2 by name, formula or identifier, for example nickel or GaAs. Not required
get_workflows Lists the Standata workflows that match a query, for example total_energy for the espresso application. Not required
save_material Saves a Standata material to the account, or reuses an identical one that is already there. Required
create_job Creates a job from saved materials and a workflow, with the cluster, queue and number of processors. Required
submit_job Submits a job to its cluster queue. Required
job_status Returns the status of a job and its compute errors, if any. Required
get_property Returns a stored property of a finished job, for example total_energy. Required

Jobs created through the server are regular jobs of the account: they appear in the web interface, and they are charged in the same way as jobs created there.

2. Authentication

The server holds no login of its own. Each request carries the credentials of its caller, the server passes them to the platform for the duration of that request, and stores nothing. Two forms of credentials are accepted.

2.1. API token

An API token is generated under Account Preferences. It consists of an account identifier and a token, the same pair that the REST API uses, sent as two request headers:

1
2
X-Account-Id: ACCOUNT_ID
X-Auth-Token: AUTH_TOKEN

This form is recommended for an MCP client that is configured once and used over time, because an API token stays valid until it is deleted.

2.2. Access token

The access token of a browser sign-in, as used by the API client and the API examples, is accepted in the Authorization header:

1
Authorization: Bearer ACCESS_TOKEN

An access token expires, and the server does not renew it. When both forms are present in a request, the access token is used.

Clients without custom headers

A client that cannot send custom request headers cannot sign in. This currently applies to connectors added in the Claude web application. Such a client can still call the tools that require no sign-in.

3. Connect a client

Any MCP client that supports the HTTP transport and custom request headers can connect. In the examples below, ACCOUNT_ID and AUTH_TOKEN stand for the two values of an API token.

3.1. Claude Code

The server is added with one command:

1
2
3
claude mcp add --transport http mat3ra https://mcp.mat3ra.com/mcp \
    --header "X-Account-Id: ACCOUNT_ID" \
    --header "X-Auth-Token: AUTH_TOKEN"

Alternatively, the server is declared in the .mcp.json file of a project. The values are read from environment variables, so that the file can be shared without the token:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "mcpServers": {
        "mat3ra": {
            "type": "http",
            "url": "https://mcp.mat3ra.com/mcp",
            "headers": {
                "X-Account-Id": "${MAT3RA_ACCOUNT_ID}",
                "X-Auth-Token": "${MAT3RA_AUTH_TOKEN}"
            }
        }
    }
}

3.2. Cursor

The server is declared in ~/.cursor/mcp.json, or in .cursor/mcp.json inside a project:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "mcpServers": {
        "mat3ra": {
            "url": "https://mcp.mat3ra.com/mcp",
            "headers": {
                "X-Account-Id": "ACCOUNT_ID",
                "X-Auth-Token": "AUTH_TOKEN"
            }
        }
    }
}

3.3. Visual Studio Code

The server is declared in .vscode/mcp.json inside a workspace:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "servers": {
        "mat3ra": {
            "type": "http",
            "url": "https://mcp.mat3ra.com/mcp",
            "headers": {
                "X-Account-Id": "ACCOUNT_ID",
                "X-Auth-Token": "AUTH_TOKEN"
            }
        }
    }
}

3.4. Without a client

Each tool call is one HTTP request, so the server can be called from a command line terminal. The first command lists the tools, and the second one calls job_status for a job:

1
2
3
4
curl -s https://mcp.mat3ra.com/mcp \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
1
2
3
4
5
6
curl -s https://mcp.mat3ra.com/mcp \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Account-Id: ACCOUNT_ID" \
    -H "X-Auth-Token: AUTH_TOKEN" \
    -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"job_status","arguments":{"job_id":"JOB_ID"}}}'

The same lines, with the order in which the tools are called, are available as plain text at https://mcp.mat3ra.com/llms.txt.

4. Example

With the server connected, a calculation is requested in plain language, for example:

1
Run a total energy calculation for silicon with Quantum ESPRESSO on Mat3ra and report the result.

The assistant then calls the tools in the following order.

  1. save_material with the query silicon saves the Standata silicon structure to the account and returns its identifier.
  2. get_workflows with the query total_energy and the application espresso returns the workflow name, Total Energy.
  3. create_job creates the job from the material and the workflow, and returns the job identifier and the address of its page in the web interface.
  4. submit_job submits the job to the queue.
  5. job_status reports the status until it is finished.
  6. get_property with the property total_energy returns the value and its units.

The assistant is instructed to show the job settings and the page address before it submits the job, so that the user can review them first.

5. Troubleshooting

The messages below are returned by a tool call when the credentials are missing or not accepted.

Message Cause
"Set the X-Account-Id and X-Auth-Token headers, or an Authorization: Bearer header" The request carries no credentials, or only one of the two API token headers.
"Error 401: You must be logged in to do this." The API token was deleted, the account identifier does not belong to the token, or the access token expired.

The first call after a period without requests can take several seconds, because the server is started on demand.