> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/rewst-agent/mcp-servers-and-rewst.md).

# MCP servers and Rewst

{% hint style="info" %}
Learn more general information about what an MCP is and what it does in our introductory AI documentation [here](/rewst-documentation/documentation/rewst-agent/ai-basics.md).&#x20;
{% endhint %}

## How is the Rewst MCP different from the Rewst Agent?

Recall that the Rewst Agent is an AI assistant, the reasoning layer that you talk to when you chat with Rewst. It runs with Rewst-specific instructions and access, as set by the Rewst engineering team, and acts as the brain and the hands that executes on what you want to do and build in Rewst.&#x20;

### The Rewst MCP

The *Model Context Protocol (MCP)* was [open sourced by Anthropic in November 2024](https://www.anthropic.com/news/model-context-protocol) to provide users and developers with an easy way to extend the capabilities of AI-powered apps by integrating them with data sources and applications. An *MCP server* is a small program that acts like a bridge between an AI tool and another piece of software. It provides context for language models— like Claude or ChatGPT— to interact with resources, run tools, and do whatever else you can think of. Instead of having the model to guess how a tool works or what data would be needed, the MCP server presents information in a format the AI tool can understand and interact with.

In Rewst’s case, the Rewst MCP exposes a set of tools for actually interacting with the Rewst platform: creating and running workflows, listing integrations, inspecting runs, fetching docs, building apps, etc. It's a service that sits between the Rewst Agent and the Rewst platform's APIs. When the Rewst Agent does something like create a workflow or check your integrations, it's calling a tool the Rewst MCP provides. The Rewst Agent understands intent, plans, and explains, whereas the Rewst MCP executes concrete platform actions at the behest of the Rewst Agent.

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2F5YMq1mASoMmda5vepu0T%2FScreenshot%202026-07-17%20at%204.00.50%E2%80%AFPM.png?alt=media&amp;token=f377263f-be3b-4c81-823f-cc472ce64e85" alt=""><figcaption></figcaption></figure>

## Add external MCPs to Rewst&#x20;

MCP is an open standard, so Rewst isn't limited to its own MCP server. If another vendor publishes an MCP server, you can register it in Rewst and use its tools via the Rewst Agent or as actions in your workflows.&#x20;

You can bring an MCP into Rewst via the standard setup for custom integration, or you can generate a token to "integrate" Rewst's own MCP to a platform of your choosing— e.g. Claude, Codex, Copilot, whatever accepts MCPs. Before you start, you'll need permission to create custom integrations, and have the vendor's MCP server URL, as well as a saved credential in Rewst that authenticates to it.

To use an MCP for an app outside of Rewst:

1. Retrieve the vendor's MCP server URL, and credentials: Bearer token, API-key header, or OAuth2.
2. Navigate to **Integrations** in the left side menu of your Rewst platform.
3. Click **Import a spec manually**.&#x20;

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2F9XrPvL7jsbaDFdATxTin%2Fimage.png?alt=media&amp;token=f5942e9c-96c7-4f23-8a4d-223080f67387" alt="" width="375"><figcaption></figcaption></figure>

4. Scroll to the right in the dialog and click **MCP Server**.

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FOuL52X9Jxki99lrNl9Fy%2Fimage.png?alt=media&amp;token=1f19c911-1083-4fcd-852c-90cc93a70af5" alt="" width="234"><figcaption></figcaption></figure>

4. Enter the MCP server URL. This is the endpoint Rewst connects to. Streamable HTTP is preferred; SSE works as a fallback.
5. Give the integration a name. This is what it will be called throughout Rewst.
6. Use the drop-down selector to select a credential.&#x20;
7. Click **Register Server**. Rewst will connect, read the server's tool list, turn each tool into an integration action, and install the integration on your organization.

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2Fpu8prPTTI1iFhv0HR4a3%2Fimage.png?alt=media&amp;token=aacd93b5-a3d4-4ec0-8a7c-9f427f8293c1" alt="" width="245"><figcaption></figcaption></figure>

## Set up your external MCP

### Via OAuth

#### Anthropic - Claude Code

{% hint style="info" %}
This configuration uses npx and requires Node.js and npm. The official installer from [nodejs.org](http://nodejs.org) includes npm. Choose the LTS version, since the helper that links Claude Desktop to Rewst's MCP server doesn't run on very old versions.
{% endhint %}

1. Add the server
   1. Run `claude mcp add --transport http rewst https://app.rewst.ai/mcp`
2. Authorize
   1. In Claude Code, run `/mcp`
   2. Select **Rewst > Authenticate**
   3. Your browser opens to app.rewst.ai; sign in and approve the requested scopes. On success the terminal reports `Authentication successful. Connected to rewst.`&#x20;
3. Verify
   1. Exit Claude Code
   2. In Claude Code: run `context_whoami on rewst`*.* You should get back your user ID, tenant ID, and granted scopes.
4. Re-authenticate
   1. Tokens expire. When tools start failing with auth errors, run `/mcp` > rewst-prod > Authenticate again. To start clean:

`claude mcp remove rewst`&#x20;

`claude mcp add --transport http rewst https://app.rewst.ai/mcp`

#### Anthropic - Claude Desktop&#x20;

1. Navigate to **Settings > Connectors** in Claude Desktop.&#x20;
2. Create a new connection in Claude Desktop.&#x20;
3. Click **+ Add > Add Custom Connector**.
4. Enter `Rewst` as the name of the connector.
5. Enter the following for the HTTPS address: `https://app.rewst.ai/mcp`.
6. Click **Continue**.
7. Follow the on-screen prompt to authorize via OAuth. log into your Rewst account.
   1. Choose **Sign in now** for the authentication.
   2. Choose **Register automatically** for the OAuth client.
8. Click **Add**.
9. Click **Connect**. You'll be prompted to log in to Claude.&#x20;
10. Click **Continue Connecting**.&#x20;
11. You'll be prompted to allow access to Rewst. Click **Allow Access**.
12. You can now invoke Rewst via a chat with Claude.

#### OpenAI - Codex

1. Add the server
   1. Run `codex mcp add rewst --url https://app.rewst.ai/mcp`
2. Authorize
   1. Run `codex mcp login rewst`
   2. Your browser opens to app.rewst.ai; sign in and approve the requested scopes.
3. Verify
   1. Run `codex mcp list` to verify it has connected.
   2. Open/restart Codex, enter `/mcp`, and ask `Run context_whoami on rewst`*.*
4. &#x20;Re-authenticate
   1. Tokens expire. When tools start failing with auth errors, run `codex mcp login rewst`&#x20;

`codex mcp remove rewst`&#x20;

`codex mcp add rewst --url https://app.rewst.ai/mcp`

### Via MCP token

1. Navigate to **Settings > AI Access** in the left side menu of your Rewst platform.
2. Click **Create Token**.
3. Choose the settings for your new token.
   1. Enter the **Token Name** into the field. We suggest `Rewst`.&#x20;
   2. Choose your **Access Level**.
      1. Restricted - The recommended level, this grants only the specific tools and role assignments this token needs
      2. Full Access - The token can do everything you can do in this organization: this option should only be chosen when you can't scope the token down to use your MCP
   3. Select **What can this token do** by checking off any of your desired tools from the list of 46 options.
   4. Optionally, select **What can this token reach**, which follows the following traditional role access sets in Rewst to inherit the resources scoped to specific role assignments.
      1. Admin&#x20;
      2. Editor&#x20;
4. Click **Generate Token**.
5. Copy the token displayed on the screen and store it somewhere secure. Once you navigate away from the screen or click **Done**, it won't be displayed again.
6. Choose from the available setup launch buttons to launch the unique instructions for that type of connection: Claude Code, Claude Desktop, or Codex setup.
7. Follow the displayed instructions to complete your setup.

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FrfWT4ZvGpisIuqenfh0C%2FScreenshot%202026-09-11%20at%202.37.49%E2%80%AFPM.png?alt=media&amp;token=4aa1d914-1d68-4596-a2f5-6586070fffbc" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/rewst-documentation/documentation/rewst-agent/mcp-servers-and-rewst.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
