AWS Neptune MCP Server

AWS Neptune MCP Server

The AWS Neptune MCP Server integrates Amazon Neptune graph database capabilities into AI applications and coding assistants, allowing seamless execution of graph queries and management operations through MCP-compliant interfaces.

Author: awslabs


View Protocol

What is AWS Neptune MCP Server?

The AWS Neptune MCP Server is a specialized MCP server that acts as a bridge between AI-powered tools and the Amazon Neptune graph database. It exposes Neptune's powerful graph querying, analytics, and management features via the standardized Model Context Protocol, enabling applications and agents to interact with Neptune's graph data using natural language or programmatic interfaces. The server supports both openCypher and Gremlin query languages, making it versatile for diverse graph workloads.

How to Configure AWS Neptune MCP Server

  1. Prerequisites:

    • Ensure you have Python installed (as specified by the MCP server requirements).
    • Install the uv tool from Astral.
  2. Credentials:

    • Set up AWS credentials with permission to access the Neptune cluster.
    • Make sure the Neptune endpoint is accessible from your environment.
  3. Configuration Example:
    Add the following configuration to your MCP client settings file (e.g., ~/.aws/amazonq/mcp.json, .cursor/mcp.json, or the file required by your tool):

    {
      "mcpServers": {
        "awslabs.amazon-neptune-mcp-server": {
          "command": "uvx",
          "args": ["awslabs.amazon-neptune-mcp-server@latest"],
          "env": {
            "NEPTUNE_HOST": "your-neptune-cluster-endpoint",
            "NEPTUNE_PORT": "8182",
            "NEPTUNE_REGION": "us-east-1",
            "AWS_PROFILE": "your-aws-profile",
            "FASTMCP_LOG_LEVEL": "ERROR"
          },
          "disabled": false
        }
      }
    }
    

    Replace the placeholders with your actual Neptune cluster endpoint, port, AWS region, and AWS profile as needed.

  4. Networking:

    • If running locally, ensure network access to the Neptune endpoint (adjust VPC or SSH tunnel settings if necessary).
  5. Start the Server:

    • Use your MCP client or tool interface to launch and connect to the server according to its documentation.

How to Use AWS Neptune MCP Server

  1. Querying the Graph:

    • Use your AI assistant or IDE integrated with MCP to send graph queries to Neptune.
    • Supported query languages include openCypher and Gremlin; specify which language in your prompt if needed.
  2. Invoking Tools:

    • Discover available Neptune operations via the tools/list endpoint of your MCP client interface.
    • Call operations such as executing Cypher or Gremlin queries, retrieving result sets, updating nodes and edges, or performing graph analytics.
  3. Example Usage:

    • In a chat interface, you can say:
      Using the Amazon Neptune MCP Server, find all users connected to account_id 12345 via a "FRIEND_OF" relationship.

    • The AI agent will automatically select the appropriate graph query language and invoke the MCP server’s interface to execute the query and return results.

  4. Workflow Automation:

    • Integrate graph search, subgraph extraction, or analytical tasks into larger automated workflows powered by your AI tools or coding assistants.
  5. Approval & Monitoring:

    • Approve tool invocations if your MCP client requires manual confirmation for database actions.

Key Features

  • Supports openCypher and Gremlin Languages: Execute complex property and traversal graph queries, compatible with most Neptune workloads.
  • Secure AWS Integration: Uses AWS credentials and profile settings; leverages AWS network security for cluster access.
  • Structured Tool Invocation: Makes Neptune operations available as callable MCP tools for programmatic or conversational use.
  • Real-time Graph Analysis: Enables near real-time query, update, and data retrieval from graph stores within your AI development workflow.
  • Flexible Deployment: Run the server locally, in containers, or as part of serverless workflows via the unified MCP architecture.
  • Scalable Performance: Handles high-volume, production-grade graph queries when configured with appropriate Neptune resources.

Use Cases

  • Code Generation for Graph Queries: Generate and test openCypher or Gremlin queries via AI-assisted prompts for application development or analytics.
  • Interactive Data Exploration: Visualize and analyze complex networks, such as social graphs, IoT networks, knowledge graphs, or recommendations.
  • Automated ETL and Data Operations: Use autonomous agents to run batch updates, data migrations, or integrity checks across large graph databases.
  • Conversational Data Insight: Enable business users to query and understand relationship data in natural language via chatbots or virtual assistants.
  • DevOps & Troubleshooting: Quickly investigate relationships and dependencies in infrastructure or operational graphs within cloud environments.

FAQ

1. What graph query languages are supported by the AWS Neptune MCP Server?
The server supports both openCypher and Gremlin, allowing you to work with whichever graph query language your use case requires.

2. Can I use the AWS Neptune MCP Server with multiple Neptune clusters?
Yes, you can configure and connect to different Neptune clusters by setting the NEPTUNE_HOST, NEPTUNE_PORT, and NEPTUNE_REGION environment variables for each MCP server instance as needed.

3. Is data access through the Neptune MCP Server secure?
Yes, all traffic uses your existing AWS credentials and enforces IAM-based access control. For enhanced security, restrict network access to your Neptune cluster using security groups and VPC settings.

4. How can I optimize performance for large graph queries?
For performance with large graphs, ensure your Neptune cluster is properly sized for your workload and consider using read replicas for heavy read operations.

5. What should I do if I get network errors connecting to Neptune?
Verify your local network or container has VPC access to the Neptune endpoint. You may need to set up an SSH tunnel or VPN if accessing from outside the AWS VPC.