Intermediate12 min read

DynamoDB MCP server: Claude Code, Cursor, Codex

The Model Context Protocol (MCP) lets an AI agent in your terminal or editor (Claude Code, Cursor, Codex, VS Code Copilot) call external tools instead of guessing.

Point one at DynamoDB and the agent can read your schema, run real reads and propose edits, without you pasting table dumps into a chat.

What matters is what you hand it. Most ways to wire an agent to DynamoDB give the MCP server process your AWS credentials, and whatever those credentials can do, an agent steered by a poisoned row or a prompt-injected document can do too.

Is there a DynamoDB MCP server?

Yes, several. AWS publishes one for data modeling and a general server for live AWS API calls. Community npm and PyPI servers expose reads, some writes too, and DynoTable acts as a local MCP server. The choice is how much power the agent gets.

  • Want an agent to read and reason over DynamoDB? Any server with live access works if the credentials behind it are read-only. Run it read-only shows how.
  • Want an agent to change data? Don't give it a direct write path. Route writes through a review step so a human commits them, which is what DynoTable's server does.

The options compared

ServerLive table accessCredentialsWrite path
AWS dynamodb-mcp-serverNo: modeling and designNot needed for modelingNone
AWS MCP Server (successor to the AWS API MCP Server)Yes, any AWS API callYour IAM credentialsWhatever your IAM policy allows
Community npm/PyPI serversYes, tool set variesKeys or profile in the server's envDirect, on write-capable servers
DynoTableYes, reads + staged editsNot passed to the agentStaged only; you commit in the app

AWS's official DynamoDB MCP server: modeling, not live ops

AWS publishes dynamodb-mcp-server in awslabs/mcp. As of 2026-10-09 its tools cover data modeling, validation, cost analysis and code generation. It does not run reads or writes against your production tables.

AWS MCP Server: live API calls under your IAM identity

For live data-plane access, AWS's general server runs AWS API calls with your IAM credentials. The older local AWS API MCP Server is now "superseded by the official AWS MCP server", a managed server with IAM access controls.

If you run the local AWS API MCP Server, READ_OPERATIONS_ONLY=true restricts it to read operations, and REQUIRE_MUTATION_CONSENT=true prompts before any non-read call (the client must support elicitation).

AWS's README adds that IAM permissions remain the primary control.

Community npm/PyPI servers

Several community DynamoDB MCP servers exist. Some expose full table and item operations, others only reads. They share a shape:

  • Your AWS credentials live in the server's environment (.env, an env block in the client config, or a named profile), with the full IAM power of those credentials.
  • No per-connection consent, scopes or write staging. A read-only server protects you by omitting write tools, so the IAM policy behind it is your real guarantee.

Run any server read-only

Whichever server you pick, make the credentials read-only and the server can't write, whatever tools it exposes or an injected prompt asks for.

Attach the AWS-managed AmazonDynamoDBReadOnlyAccess policy to a dedicated role or user. It allows GetItem, BatchGetItem, Query, Scan, PartiQLSelect, Describe* and List*, and no write action.

Add a named profile for that role in ~/.aws/config:

[profile dynamodb-readonly]
role_arn = arn:aws:iam::123456789012:role/DynamoDBReadOnly
source_profile = default
region = us-east-1

The role's trust policy must allow your default identity to assume it.

Then point the server at the profile in its env block, so no key sits in the client config. Most servers read AWS_PROFILE; the AWS API MCP Server reads AWS_API_MCP_PROFILE_NAME. In Claude Code:

claude mcp add --env AWS_API_MCP_PROFILE_NAME=dynamodb-readonly --env READ_OPERATIONS_ONLY=true \
  --transport stdio aws-api -- uvx awslabs.aws-api-mcp-server@latest

The same env entry for Cursor and Codex is on their pages.

To narrow further, swap the managed policy for one scoped to the table ARNs the agent needs.

Keep the agent's own shell away from your AWS files

A server that never hands the agent a key doesn't stop the agent from finding one. Your profiles live in ~/.aws, including the default keys a read-only role is assumed from.

Claude Code and Codex run shell commands as your user, and so does Cursor's agent terminal. Any of them can read ~/.aws/credentials or run the AWS CLI unless you block it in the client:

  • Claude Code: sandbox its Bash tool and deny ~/.aws, plus a Read deny rule for the file tool (the settings).
  • Codex: a permission profile (beta) can deny reads of a path such as ~/.aws for the commands Codex runs (OpenAI's permissions docs).
  • Cursor: set "readBoundary": "workspace" in ~/.cursor/sandbox.json (Cursor 3.23 or later). Sandboxed terminal commands then can't read outside the workspace, and the agent asks before reading files there. A command run outside the sandbox isn't covered, and in Cursor's default Auto-review run mode a classifier, not you, approves that rerun. Use the Allowlist run mode (Settings → Agents → Approvals & Execution) so it comes to you (the setting, run modes).

DynoTable as an MCP server

DynoTable is a desktop DynamoDB client that can act as a local MCP server. An external agent connects to it and gets a subset of the toolkit DynoTable's built-in assistant uses. Two properties differ from the servers above:

  • DynoTable never passes your AWS credentials to the agent. It makes the DynamoDB calls with your profile; the agent talks to DynoTable, not to AWS. The keys still sit in ~/.aws, so keep the agent's shell away from them.
  • The agent has no tool that writes to DynamoDB. Every change it proposes lands in DynoTable's staging area, and only you can commit it.

The server is off by default and listens on 127.0.0.1 only. Every connection is approved per client at a scope you choose and revocable.

It doesn't make prompt injection impossible: a steered agent can still read anything the profile can read and repeat it. What it removes is the direct write.

To bound the reads, make available to agents a profile whose IAM role can read only the tables the agent needs (a table-ARN-scoped read policy, as in Run any server read-only), not your admin profile. The connection uses exactly the profile you approve.

Enable it and connect a client

  1. Make a profile available to agents. Open the profile's MCP section in DynoTable's settings and turn on Available to agents. With no profile available, every connection is refused. The same switch lets dynotable-cli read the profile.
  2. Turn the server on in Settings → MCP. It binds a loopback port.
  3. Copy the connect snippet from the profile's MCP section. It carries the real port and a ?profile=<slug> hint.

Claude Code, Cursor and Codex each have a walkthrough with the exact config, the login step and that client's usual mistakes: Claude Code · Cursor · Codex. For the two clients without one:

Run MCP: Open User Configuration and add it to your user mcp.json (Copilot agent mode), which every workspace sees. DynoTable's snippet points there too, not at .vscode/mcp.json, a workspace file you'd commit. VS Code's add-server flow lists that user file as deprecated, kept for compatibility, and prefers the portable ~/.copilot/mcp-config.json (servers under a top-level mcpServers key) for new servers; the user mcp.json still works:

{
  "servers": {
    "dynotable-prod": {
      "type": "http",
      "url": "http://127.0.0.1:<port>/mcp?profile=prod"
    }
  }
}

The endpoint is OAuth-protected. On first use your client opens a browser login, and DynoTable shows a consent prompt naming the client.

Scopes: what each grant allows

The consent prompt asks which scope to grant, or lets you deny:

  • Read only: read your schema, run queries and read items. No changes.
  • Read & stage: the above, plus staging changes for you to review and commit. This includes staging a bulk edit or delete of the items a filter matches; nothing is deleted until you commit.
  • Full access: the above, plus opening views, setting filters and exporting. Writes still go through staging.

Start at Read only. A grant can't be narrowed in place: the MCP pane offers Revoke and Revoke all, and a revoked client fails on its next request. To change a client's scope, revoke it and approve the reconnect at the scope you want.

Without an active plan or trial, DynoTable clamps every connection to Read only (staging is refused) and hides the Workbench SQL tool, whatever scope you granted. See pricing.

What the agent can run

There is no raw Query or Scan tool. The agent reads through a PartiQL SELECT (DynamoDB runs it as a Query when the WHERE pins the partition key, otherwise as a Scan), GetItem, an item count, and Workbench SQL for JOIN / GROUP BY aggregates.

Each Workbench SQL call scans its FROM table in full before the SQL runs, whatever its WHERE, so one aggregate costs one full pass (the figure below). A JOIN on the partition key of a table with no sort key, or on an attribute that is the partition key of exactly one of its GSIs, reads that side by key. Any other join, including one on the partition key of a table that has a sort key, scans that table too. The item count pages through Scan as well. Over MCP, DynoTable stops a single call after 50 million items, about 50 GB or 30 minutes of scanning, and you pay for what it read before it stopped.

PartiQL results come back capped at 10 rows or 5 KB per call, so the agent can't pull a table into its context. The full list is in the AI tools docs.

What agent queries cost on DynamoDB

A Scan bills for every item it evaluates, not the ones a filter returns. DynamoDB sums the item sizes, rounds up to the next 4 KB, and charges 0.5 read request units per 4 KB for an eventually consistent read on an on-demand table.

A 50 GB table is about 6.55 million read request units per full pass (52,428,800 KB ÷ 4 × 0.5), roughly $0.82 at us-east-1 list price ($0.125 per million). An agent that rescans while it explores pays that each time.

On a provisioned table the same pass draws on your RCU and can throttle your application's reads.

Read only scope stops writes, not reads: a read-only agent can still scan a whole table. The controls that bound read cost are elsewhere:

  • Pin the partition key in PartiQL. Ask for the schema first, then have the agent put = or IN on the partition key in its WHERE, so the statement runs as a Query. AWS: "the WHERE clause condition must specify a partition key." This doesn't apply to Workbench SQL, which scans its FROM table either way.

  • Keep per-call approval on for this server in your client, so you see each statement, and the tables a Workbench SQL call names, before it runs. In Cursor that means the Allowlist run mode with this server's tools left off the list (Cursor guide); its default Auto-review mode has a classifier approve them.

  • Cap the table's rate. Set a maximum read throughput on an on-demand table; requests above it are throttled. It limits units per second, not the total, and it throttles your application too, so set it above normal peak.

  • Deny PartiQL full scans in IAM. A Deny on dynamodb:PartiQLSelect with the dynamodb:FullTableScan condition set to true (AWS example) refuses a PartiQL SELECT that would scan. It doesn't cover the Scan API.

  • Deny dynamodb:Scan on your largest tables when the agent only needs keyed lookups there. Put the Deny on those table ARNs, in a role you keep for the agent.

    It blocks more than the full pass: Workbench SQL with the table in FROM, the item count, and the schema lookup (getSchema, getSampleValues), which samples items with a Scan. DynoTable's own table view fails on it too, since it scans.

    describeTable still returns the keys and indexes, and keyed PartiQL, GetItem and a JOIN into the table on an attribute that is the partition key of exactly one of its GSIs (or on its own partition key, if it has no sort key) still work, so give the agent the attribute names it needs.

Estimate a pass for your own table in the pricing calculator, and see why Scan is slow and expensive for the alternatives.

Is it safe to give an AI agent DynamoDB access?

It depends on the path. Read access on a non-sensitive table is low risk once the credentials are read-only.

Write access is what to decide: don't give an autonomous agent both credentials and a direct write path. Keep it read-only, or route every change through a review step a human approves.

DynoTable takes the second route: it never passes the agent your keys and gives it no write tool; you commit from the staging area.

Can an MCP agent write to my DynamoDB tables?

With a write-capable server and write-capable credentials, yes, directly. With a read-only IAM profile, no: the write fails with an access-denied error.

With DynoTable, not directly. At Read & stage or Full access the agent can stage a change, which appears as a reviewable diff and is written only when you commit it.

Product names are trademarks of their respective owners; referenced for identification only. AWS server details verified 2026-10-09; these servers change, so re-check the awslabs repo before relying on a tool list.

By Dmitriy · Updated