This MCP server enables users to interact with AWS Amplify Gen2 application data through natural language, allowing AI assistants like Claude to perform operations on Amplify data models using conversational language instead of complex code.
This MCP (Model Context Protocol) server lets you interact with your AWS Amplify Gen2 application's data through natural language. It allows AI assistants like Claude to perform operations on your Amplify data models using conversational language instead of complex code or commands.
This MCP server uses Cognito authentication to access your Amplify data. Your Amplify project must be configured to use Cognito-based authentication. The server will only have access to data models and records that the authenticated user has permission to access.
For optimal functionality, we strongly recommend:
Example model authorization for admin access:
// In your Amplify model definition authorization: (allow) => [ allow.authenticated().to(["read"]), allow.group("ADMINS").to(["create", "read", "update", "delete"]), ];
Without proper admin permissions, the MCP server will be limited in what it can do with your data.
amplify_outputs.json
)Clone the repository:
git clone https://github.com/dbsmith7491/aws-amplify-data-mcp.git cd aws-amplify-data-mcp
Install dependencies:
npm install
Build the project:
npm run build
To use this with Claude Desktop:
Open Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%AppData%\Claude\claude_desktop_config.json
Create the file if it doesn't exist.
Add the Amplify MCP server configuration:
{ "mcpServers": { "amplify-data-api": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/aws-amplify-data-mcp/build/index.js", "--amplify-outputs", "/ABSOLUTE/PATH/TO/YOUR/amplify_outputs.json" ], "env": { "AMPLIFY_USERNAME": "your-admin-username", "AMPLIFY_PASSWORD": "your-admin-password" } } } }
Replace the paths and credentials with your own. For full functionality, use credentials for a user in the ADMINS group.
Restart Claude Desktop
Once configured, you can interact with your Amplify data using everyday language in Claude. Simply include the @amplify-data-api
tag at the beginning of your message to direct your question to the Amplify server.
Here are some examples of how you can interact with your data:
Claude will interpret these natural language requests and convert them into the appropriate GraphQL queries and mutations.
The server provides the following tools:
List all data models:
Get model details:
Run GraphQL queries and mutations:
Get relationship details:
List enums:
Manual login (if needed):
Here's how a typical conversation with Claude might flow:
You: @amplify-data-api What data models do I have available?
Claude: I'll check your Amplify app for available data models.
I found the following models:
- Story
- Character
- Location
- World [more details about each model...]
You: @amplify-data-api Tell me about the Story model
Claude: Here are the details for the Story model:
Fields:
- id: ID (required)
- title: String (required)
- description: String
- numberOfPages: Int [other fields...]
You: @amplify-data-api Can you create a new Story called "Claude's Adventure" about an AI exploring a magical world?
Claude: I'll create that Story for you using a GraphQL mutation. Here's what I'll submit:
mutation CreateStory { createStory( input: { title: "Claude's Adventure" description: "A tale about an AI exploring a magical world" status: "draft" } ) { id title description status createdAt updatedAt } }
You: Yes, please create it
Claude: I've created the Story! Here's the new record:
{ "id": "abc123", "title": "Claude's Adventure", "description": "A tale about an AI exploring a magical world", "status": "draft", "createdAt": "2023-06-15T10:30:45Z", "updatedAt": "2023-06-15T10:30:45Z" }
You: @amplify-data-api Now let's add a character to this story
Claude: [continues the interaction naturally...]
src/
directorybuild/
npm run build
after any source code changesIf you receive this project as a ZIP file, follow these steps to get it working:
npm install
npm run build
If you want to distribute this project to others:
src/
directory with all TypeScript source filespackage.json
and other configuration filesbuild/
directory if you've already built the projectOptions:
--amplify-outputs Path to the amplify_outputs.json file
--help, -h Show this help message
Environment Variables:
AMPLIFY_USERNAME Cognito username for automatic login
AMPLIFY_PASSWORD Cognito password for automatic login
Need more help? Contact your development team for support.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!