DynamoDB Read-Only MCP
DynamoDB 読み取り専用 MCP
モデルコンテキストプロトコル(MCP)を利用してAWS DynamoDBデータベースにクエリを実行するサーバー。このサーバーにより、ClaudeのようなLLMは自然言語リクエストを通じてDynamoDBデータをクエリできるようになります。
特徴
この MCP サーバーは次の機能を提供します。
テーブル管理ツール:
list-tables: すべての DynamoDB テーブルのリストを表示するdescribe-table: 特定のテーブルに関する詳細情報を表示する
データクエリツール:
scan-table: テーブルのデータ全体または一部をスキャンするquery-table: テーブル内の特定の条件に一致するデータを検索するpaginate-query-table: 特定の条件に一致する複数のページにわたるデータを取得するget-item: 特定のキーを持つアイテムを取得するcount-items: テーブル内のアイテム数を計算する
リソース:
dynamodb-tables-info: すべてのテーブルのメタデータを提供するリソースdynamodb-table-schema: 特定のテーブルのスキーマ情報を提供するリソース
プロンプト:
dynamodb-query-help: DynamoDB クエリを書くためのヘルププロンプト
Related MCP server: Azure Cosmos DB MCP Server
インストールと実行
以下のRun with NPXメソッドを使用すると、インストールせずに実行できます。
Smithery経由でインストール
Smithery経由で Claude Desktop 用の DynamoDB 読み取り専用サーバーを自動的にインストールするには:
npx -y @smithery/cli install @jjikky/dynamo-readonly-mcp --client claudeインストール
リポジトリをクローンします。
git clone https://github.com/jjikky/dynamo-readonly-mcp.git cd dynamo-readonly-mcp必要なパッケージをインストールします。
npm install.envファイルを作成し、AWS 認証情報を設定します。AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_REGION=your_region
ビルドと実行
npm run build
npm startClaudeデスクトップに接続
この MCP サーバーを Claude Desktop で使用するには、Claude Desktop 構成ファイルを変更する必要があります。
Claude Desktop 構成ファイルを開きます。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
次のようにサーバー構成を追加します。
{ "mcpServers": { "dynamodb-readonly": { "command": "node", "args": ["/absolute-path/dynamo-readonly-mcp/dist/index.js"], "env": { "AWS_ACCESS_KEY_ID": "your_access_key", "AWS_SECRET_ACCESS_KEY": "your_secret_key", "AWS_REGION": "your_region" } } } }Claude Desktop を再起動します。
NPXで実行
グローバルインストールなしでnpxを使用してこのサーバーを実行することもできます。
{
"mcpServers": {
"dynamodb-readonly": {
"command": "npx",
"args": ["-y", "dynamo-readonly-mcp"],
"env": {
"AWS_ACCESS_KEY_ID": "your_access_key",
"AWS_SECRET_ACCESS_KEY": "your_secret_key",
"AWS_REGION": "your_region"
}
}
}
}使用例
クロードに次のような質問をすることができます:
「DynamoDB にはどのようなテーブルがあるのか教えていただけますか?」
「Usersテーブルの構造を説明する」
「「Users」テーブルで、グループIDが「0lxp4paxk7」であるユーザーの数を見つけます」
建築
この MCP サーバーは次の階層構造で構成されています。
クライアントインターフェース(Claude Desktop) - ユーザーとLLM間のインタラクション
MCPプロトコル層- 標準化されたメッセージ交換方法を提供する
DynamoDB サーバー- DynamoDB と対話する関数を実装します
AWS SDK - AWS DynamoDB サービスと通信します
主要な操作メカニズム
1. 初期化と接続
サーバーが起動すると、次のプロセスが実行されます。
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('DynamoDB read-only MCP server is running...');
}StdioServerTransport標準入出力を介して通信チャネルを設定します。server.connect(transport)MCP プロトコルを介して Claude Desktop に接続します。接続中に、サーバーはサポートされているツール、リソース、およびプロンプトに関する情報をクライアントに送信します。
2. ツール要求処理
ユーザーが Claude に「DynamoDB テーブルのリストを表示してください」のような質問をした場合:
クロードはこのリクエストを分析し、
list-tablesツールを呼び出します。この要求は、MCP プロトコルを通じてサーバーに送信されます。
サーバーは対応するツール ハンドラーを実行します。
server.tool('list-tables', 'Gets a list of all DynamoDB tables', {}, async () => {
try {
const tables = await listTables();
return {
content: [{ type: 'text', text: JSON.stringify(tables, null, 2) }],
};
} catch (error) {
return { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] };
}
});結果は MCP プロトコルを通じて Claude に返されます。
クロードはこの結果を自然言語に変換し、ユーザーに提示します。
3. 特定のパラメータ処理
ユーザーが「Users テーブルの構造を教えてください」と要求した場合:
Claude は、このリクエストでは
describe-tableツールを使用する必要があると判断しました。Claude はパラメータを
{ tableName: "Users" }として設定します。この情報は MCP サーバーに送信されます。
server.tool(
'describe-table',
'Gets detailed information about a DynamoDB table',
{
tableName: z.string().describe('Name of the table to get detailed information for'),
},
async ({ tableName }) => {
// Query table information using the tableName parameter
const tableInfo = await describeTable(tableName);
// Return results
}
);ここで、 z.string()は Zod ライブラリを使用してパラメータを検証します。
4. リソースの取り扱い
リソースは、読み取り専用データを提供するもう 1 つの MCP 機能です。
server.resource('dynamodb-tables-info', 'DynamoDB table information', async () => {
// Create and return resource data
const tables = await listTables();
const tablesInfo = await Promise.all(/* Query table information */);
return {
contents: [
{
uri: 'dynamodb://tables-info',
text: JSON.stringify(tablesInfo, null, 2),
mimeType: 'application/json',
},
],
};
});クロードはリソースにアクセスし、それをコンテキスト情報として使用します。
5. 迅速な対応
MCP サーバーは、特定のタスクのプロンプト テンプレートを提供できます。
server.prompt(
'dynamodb-query-help',
'A prompt that helps write DynamoDB queries',
{
tableName: z.string().describe('Table name to query'),
queryType: z.enum(['basic', 'advanced']).default('basic'),
},
async ({ tableName, queryType }) => {
// Generate prompt content
return {
messages: [
{
role: 'user',
content: { type: 'text', text: helpContent },
},
],
};
}
);このプロンプトは、ユーザーが「Users テーブルのクエリの記述方法を教えてください」と要求したときに使用されます。
データフローの概要
ユーザーは自然言語でクロードにリクエストを送信します
クロードはリクエストを分析し、適切なMCPツール/リソース/プロンプトを選択します。
MCPクライアントは標準化された形式でサーバーにリクエストを送信します。
サーバーはリクエストを処理し、AWS DynamoDB API を呼び出します。
DynamoDBは結果を返します
サーバーは結果をMCP形式に変換し、クライアントに送信します。
クロードは結果を自然言語で処理し、ユーザーに提示します。
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。
Available Tools
7 toolscount-itemsB
Count items in a DynamoDB table
Inputs: tableName (required), expressionAttributeValues, filterExpression.
describe-tableC
Get detailed information about a DynamoDB table
Inputs: tableName (required).
get-itemC
Get an item from a DynamoDB table based on a specific key
Inputs: key (required), tableName (required).
list-tablesB
Get a list of all DynamoDB tables
Inputs: no named parameters.
paginate-query-tableC
Paginate query results
Inputs: expressionAttributeValues (required), keyConditionExpression (required), tableName (required), projectionExpression.
query-tableC
Query items from a DynamoDB table based on conditions
Inputs: expressionAttributeValues (required), keyConditionExpression (required), tableName (required), filterExpression, +3 more.
scan-tableC
Scan items from a DynamoDB table
Inputs: tableName (required), expressionAttributeValues, filterExpression, limit, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Every tool has a clearly distinct purpose with no ambiguity: count-items focuses on counting, describe-table on metadata, get-item on single retrieval, list-tables on table enumeration, paginate-query-table on pagination, query-table on conditional queries, and scan-table on full scans. The descriptions clearly differentiate each tool's function, making misselection unlikely.
All tool names follow a consistent verb_noun pattern with hyphens (e.g., count-items, describe-table, get-item). There are no deviations in style or convention, making the naming predictable and easy to understand across the entire set.
With 7 tools, the count is well-scoped for a read-only DynamoDB server, covering essential operations like listing, describing, retrieving, querying, scanning, and counting. Each tool earns its place without redundancy, fitting within the typical 3-15 range for focused server purposes.
The tool set provides comprehensive read-only coverage for DynamoDB, including table listing, metadata retrieval, item access, queries, scans, and pagination. A minor gap exists in not supporting batch operations like batch-get-item, but agents can work around this with existing tools, and the core read workflows are well-covered.
Maintenance
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
The Ramp MCP server enables users to securely connect Ramp with AI assistants like ChatGPT and Claude to query financial data and take actions using natural language. It transforms Ramp's developer API into a SQL interface that LLMs can query, allowing admins to analyze spend trends, identify cost savings, and run complex SQL analyses on comprehensive datasets (transactions, purchase orders, vendors, users), while all users can manage cards, view transactions, request reimbursements, and get expense policy answers.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.1-
- AlicenseBqualityDmaintenanceA server that enables LLMs like Claude to interact with Azure Cosmos DB databases through natural language queries, acting as a translator between AI assistants and database systems.43MIT
- AlicenseCqualityCmaintenanceA server that enables LLMs (like Claude and VSCode Copilot) to interact with Azure Cosmos DB data through natural language queries, acting as a translator between AI assistants and your database.321 npm3MIT
- AlicenseNot gradedqualityDmaintenanceThis server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.MIT