---
title: Set up Amazon Bedrock AgentCore
description: 'Add Charming as an external MCP server target in an AgentCore Gateway.'
sidebar:
  label: AgentCore
  order: 16
---

You need an AgentCore Gateway and permission to manage targets and credentials.

## Get a Charming token

Start a device pairing from a terminal:

```sh
curl -sS -X POST https://charm.ing/api/pair/start \
  -H 'Content-Type: application/json' \
  -d '{"label":"Amazon Bedrock AgentCore"}'
```

Open [charm.ing/pair](https://charm.ing/pair), enter the `user_code` from the response, and approve access. Then poll with the `device_code`:

```sh
curl -sS -X POST https://charm.ing/api/pair/poll \
  -H 'Content-Type: application/json' \
  -d '{"device_code":"PASTE_DEVICE_CODE"}'
```

Copy the `chrm_user_*` token from the first `approved` response. Charming returns it once.

## Add Charming as a target

1. Open your AgentCore Gateway.
2. Add an **MCP server target**.
3. Set the server URL to:

   ```text
   https://charm.ing/mcp
   ```

4. Choose **API key** authorization and create an AgentCore API key credential provider with the `chrm_user_*` token.
5. Set the credential location to the `Authorization` header and the credential prefix to `Bearer `.
6. Grant the gateway role access to the credential provider.
7. Synchronize the target and wait for its status to become ready.
8. Add the gateway to your AgentCore agent and test `list_apps`.

AgentCore calls Charming's tools. Finished apps open at their Charming URL.

See AWS's guides for [external MCP server targets](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html) and [target authorization](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-building-adding-targets-authorization.html).

Paired tokens expire after 30 days. Pair again to replace one, then revoke the old token on your [Connections settings](https://charm.ing/account/agents).

## Build without an MCP target

The `chrm_user_*` token above is not limited to MCP. An AgentCore agent that makes its own outbound HTTP requests can call Charming's HTTP API with the same `Authorization: Bearer` header and skip the gateway target. The routes are in [Build over the HTTP API](../guides/build-over-the-http-api).

Give the agent this instruction:

```text
Use Charming's HTTP API with the chrm_user_* token I gave you. Read
https://charm.ing/docs/build-http.md, then ask me what I want to build.
```

Both paths build the same apps in the same account.

## Related

- [AI clients](.)
- [Charming auth](https://usecharming.com/auth.md)

Found a bug or need a feature? [Tell us](/docs/capabilities/feedback) with `submit_feedback` or `POST /app/{id}/feedback`. Your feedback shapes what we build next.
