Live AWS, database & Kafka infrastructure context for AI coding assistants via MCP.
io.github.Sidd27/infrawise MCP Server
Infrawise is an MCP server that provides live AWS, database, and Kafka infrastructure context for AI coding assistants. Its purpose is to help assistants work with infrastructure details exposed through the Model Context Protocol. The project is associated with TypeScript tooling and infrastructure-related workflows.
๐ ๏ธ Key Features
Live AWS infrastructure context
Live database context
Live Kafka context
MCP server implementation
TypeScript-based tooling
๐ Use Cases
Supplying infrastructure context to AI coding assistants
Assisting infrastructure analysis workflows
Supporting serverless infrastructure contexts
โก Developer Benefits
Integrates with MCP-based toolchains
Fits with common AWS and IaC components
Topics include DynamoDB, Lambda, Terraform, and serverless
โ ๏ธ Limitations
Description does not specify supported MCP transport methods, auth model, or database/Kafka connector details.
Infrawise gives AI coding assistants deterministic infrastructure awareness.
It statically analyzes your codebase, cloud infrastructure, and database schemas, then exposes that context through MCP so tools like Claude Code can understand your actual tables, indexes, query patterns, and service relationships instead of guessing from source files alone.
infrawise start --claude, then Claude Code answers an SQS handler question with the exact event shape and queue risks pulled live from infrawise
Why this exists
New software developers don't write wrong code. Claude Code writes wrong code and they ship it. Infrawise is the only thing standing between Claude Code's generated output and a production incident.
AI coding assistants can read your source files but have no deterministic knowledge of your infrastructure. They do not know which GSIs exist, how tables are partitioned, which functions already trigger scans, or where indexes are missing. So they guess.
Infrawise replaces guessing with infrastructure-aware context.
Without Infrawise, an AI assistant might:
Suggest a .scan() on your Orders table that has 50M rows
Recommend adding a GSI on status that you already have
Write a SELECT * when you need to keep query cost low
Not notice that 5 functions are already hammering the same partition key
With Infrawise, it knows:
Your exact table schemas, partition keys, sort keys, and GSIs
Which functions query which tables and how
Which patterns are already flagged as high severity
The exact CREATE INDEX SQL or GSI config for your tables โ not generic advice
What Infrawise is not
Infrawise is not an AI agent framework, an infrastructure provisioning tool, an observability platform, or a cloud management dashboard.
It is a deterministic infrastructure intelligence layer for AI-assisted development.
Installation
Requires Node.js 22 or later (node --version).
bash
npm install -g infrawise
or use without installing:
bash
npx infrawise start --claude
Quick start
bash
cd your-project
infrawise start --claude
That's it. Infrawise will:
Probe your environment and generate infrawise.yaml (first time only โ asks which AWS profile to use only if you have several)
Scan your AWS services, databases, and codebase
Write .mcp.json so your editor auto-connects on every future launch
Open Claude Code with all 22 MCP tools ready
Every time after:
bash
claude # no infrawise command needed โ editor manages the connection
Analysis is cached for 24 hours. When the cache is stale, infrawise serve --stdio (spawned automatically by your editor) refreshes it at session start. File changes are detected within the session and the code graph is updated automatically.
code
Findings (3 total)
1. [HIGH] Full table scan detected on DynamoDB table "Orders"
listAllOrders() scans without any filter โ reads every item in the table.
Recommendation: Replace Scan with Query using a partition key or add a GSI.
2. [MEDIUM] PostgreSQL table "users" has no index on column "email"
Filtering on "email" causes sequential scans.
Recommendation: CREATE INDEX CONCURRENTLY idx_users_email ON users(email);
3. [MEDIUM] DynamoDB table "Sessions" accessed by 6 distinct code paths
High access concentration may create hot partition issues at scale.
Using with AI coding assistants
Claude Code (recommended)
bash
infrawise start --claude
Writes .mcp.json to your project root (merging with any MCP servers already configured there) and opens Claude Code. Claude Code reads .mcp.json automatically on every launch and manages the infrawise serve --stdio process โ no server to start, no ports to configure.
Cursor
bash
infrawise start --cursor
Writes .cursor/mcp.json (merging with any existing MCP servers) and opens Cursor. All 22 infrawise tools are available in Cursor's MCP panel.
VS Code
bash
infrawise start --vscode
Writes .vscode/mcp.json (merging with any existing MCP servers) and opens VS Code. The tools are available to Copilot agent mode via the MCP servers panel.
Any editor (no flag)
bash
infrawise start
Writes .mcp.json (merging with any existing MCP servers) and exits. Open whichever editor you prefer โ point it at infrawise serve --stdio --config /path/to/infrawise.yaml as an MCP server command.
HTTP transport (alternative)
If your editor or workflow requires an HTTP MCP endpoint instead of stdio:
bash
infrawise serve # starts server at http://localhost:3000/mcp
Complete snapshot โ services, counts, high-severity findings, configured flag (data age and per-source status ride the dataHealth block on every response)
get_graph_summary
Full infrastructure graph โ all nodes, edges, and findings
get_table_schema
Column-level schema for named tables/collections โ types, PKs, FKs, indexes, DynamoDB keys/billing mode, cost signal (no row data)
analyze_function
Issues in a specific function โ scans, missing indexes, N+1, trigger event shapes, missing IAM permissions; returns every same-named file as a separate match, or bind to one with the optional file input; names refused Lambda links and why (unresolvedLambdas)
suggest_gsi
Exact GSI config for a DynamoDB table + attribute โ names the existing index instead when one already covers it
postgres_index_suggestions
Exact CREATE INDEX SQL for your actual table
suggest_mongo_index
Exact createIndex command for a MongoDB collection + field
mysql_index_suggestions
Exact ALTER TABLE ADD INDEX SQL for your MySQL table
API Gateway APIs (REST, HTTP, WebSocket) โ routes, HTTP methods, paths, and Lambda integrations
get_topic_details
SNS topics โ subscription counts, protocols, and filter policies (required message attributes per subscription)
get_secrets_overview
Secrets Manager โ names, rotation status, and key names inferred from code (values never included)
get_parameter_overview
SSM Parameter Store โ names, types, tiers (values never included)
get_lambda_overview
Lambda functions โ runtime, memory, timeout, execution role ARN, triggers (SQS/SNS/DynamoDB/Kinesis/MSK/EventBridge/S3), env var key names, cost signal, why a Lambda could not be linked to its source (unresolvedLink)
ElastiCache clusters โ engine, encryption in transit/at rest, replication group, failover, cost signal (data never read)
get_cloudfront_overview
CloudFront distributions โ per-behavior path patterns, origins (S3 vs custom, resolved API Gateway name), cache policy, viewer protocol policy
Every response carries a dataHealth block with a fixed shape: when the infrastructure was read and how long ago, the status of each source behind that answer, whether cdk.out has been synthed since, and the command that refreshes. Every key is always present, so nothing has to be inferred from a field's absence โ an empty result you can't distinguish from a failed one reads as "no queues need a DLQ" when the truth is "SQS was never listed".
Infrawise reports; it doesn't rule. Pass maxAgeSeconds when a question is point-in-time and the answer tells you whether the data meets it (advisory โ the data still comes back, marked). A running server rechecks the cache on each tool call, so an open session picks up a fresh infrawise analyze on its next question, without a restart. infrawise analyze and infrawise check print the same source warnings and stop calling a run clean when any source went unread.
Age is a proxy for drift, not drift itself โ a three-day-old snapshot of an untouched account is accurate, and a five-minute-old one taken before a terraform apply isn't. How Infrawise handles staleness covers where that proxy misleads and what to do about it; the data freshness reference is the field-by-field table and the freshness config key.
Save findings as a markdown report, e.g. report.md
--severity <level>
Only show findings at or above this level: high | medium | low
bash
# Export a shareable findings report
infrawise analyze --output report.md
# Only show high-severity issues
infrawise analyze --severity high
# High-severity issues only, saved to a file
infrawise analyze --severity high --output report.md
infrawise check options (CI/CD)
check runs a fresh analysis and sets a non-zero exit code when blocking findings exist, so it can gate a pipeline without an AI editor.
Flag
Description
-c, --config <path>
Path to infrawise.yaml (default: infrawise.yaml)
-r, --repo <path>
Repository to scan (default: current directory)
--fail-on <level>
Severity that fails the build: high (default) | medium | low
bash
# Block a deploy if any high-severity finding exists (exit 1)
infrawise check
# Stricter gate โ fail on medium and above
infrawise check --fail-on medium
infrawise serve options
Flag
Description
-c, --config <path>
Path to infrawise.yaml (default: infrawise.yaml)
--stdio
Use stdio transport (for editors via .mcp.json) instead of HTTP
-p, --port <number>
Port to listen on, HTTP only (default: 3000)
Configuration
infrawise.yaml is generated by infrawise start (or infrawise start --interactive for the guided wizard) and lives in your repo root. Every service must be explicitly enabled: true โ infrawise never connects to anything not listed in config.
Connection strings support ${ENV_VAR} substitution so passwords never need to be committed:
project:payments-serviceaws:profile:default# AWS profile from ~/.aws/credentialsregion:ap-south-1dynamodb:enabled:trueincludeTables:# omit to include all tables-Orders-Userspostgres:enabled:trueconnectionString:postgresql://infrawise_ro:${DB_PASSWORD}@host:5432/mydbmysql:enabled:falseconnectionString:''mongodb:enabled:falseconnectionString:''sqs:enabled:truesns:enabled:truessm:enabled:truepaths: [] # filter by prefix e.g. ["/myapp/prod"]secretsManager:enabled:truelambda:enabled:trueincludeFunctions:# omit to include all functions-myFunction-anotherFunctioneventbridge:enabled:truerds:enabled:falses3:enabled:falseapiGateway:enabled:falsecognito:enabled:falsekinesis:enabled:falsemsk:enabled:falseelasticache:enabled:falsecloudfront:enabled:falseruntimeSignals:enabled:false# Lambda throttles/errors + queue age via CloudWatch metricswindowHours:24cloudwatchLogs:enabled:falselogGroupPrefixes: []
windowHours:24analysis:hotPartitionThreshold:5hotPartitionThresholds:high-traffic-table:12freshness:suggestRefreshAfterHours:6# when MCP responses start hinting to re-analyze
AWS setup
Infrawise is read-only. Minimum IAM policy for DynamoDB:
For the full policy across all supported services, how to scope it to only the services you enable, and using a session policy for temporary scoped credentials, see the AWS setup guide.
For SSO profiles, log in before running infrawise:
bash
aws sso login --profile myprofile
PostgreSQL setup (optional)
Create a read-only user for infrawise:
sql
CREATEUSER infrawise_ro WITH PASSWORD 'yourpassword';
GRANTCONNECTON DATABASE yourdb TO infrawise_ro;
GRANT USAGE ON SCHEMA public TO infrawise_ro;
GRANTSELECTONALL TABLES IN SCHEMA public TO infrawise_ro;
For Amazon RDS: allow inbound on port 5432 from your machine's IP in the security group.
Analysis capabilities
Infrawise has two analysis layers:
Infrastructure analysis (all languages)
Works from AWS APIs, database schema introspection, and IaC files โ no dependency on application code:
Service
What it checks
DynamoDB schema
Tables, GSIs, partition keys, billing mode, cost signal (provisioned capacity)
PostgreSQL / MySQL schema
Tables, indexes, column types
MongoDB schema
Collections, indexes
SQS
Missing DLQs, unencrypted queues, large backlogs, FIFO detection, visibility timeout below the consumer Lambda timeout (high) or below AWS's recommended 6ร (medium)
SNS
Subscription filter policies โ required message attributes per subscription
Apache Kafka (kafkajs)
Producer/consumer topic mapping from code โ any broker (self-hosted, Confluent, Redpanda, MSK); distinct from the MSK Lambda trigger
Secrets Manager
Missing secret rotation
Lambda
Default memory (128 MB), high timeouts, triggers (SQS/SNS/DynamoDB/Kinesis/MSK/EventBridge/S3), missing DLQ on trigger source, cost signal (high memory with no throttling evidence)
S3
Public access blocking (verify), missing versioning, missing encryption
Uses ts-morph AST analysis to detect which functions call which tables and how:
Python repositories are scanned with a bundled stdlib-ast scanner (requires python3 on PATH; skipped with a warning otherwise): boto3 clients and dynamodb.Table() resources, cursor.execute SQL, pymongo collections, and kafka-python/confluent-kafka producers and consumers. Language detection is automatic โ TypeScript and Python scans each run only when matching files exist.
Analyzer
Severity
What it detects
Full Table Scan (DynamoDB)
High
.scan() calls without filters
Missing GSI
Medium
Queries on attributes without a matching GSI
Hot Partition
Medium
5+ distinct code paths hitting the same table
Missing Index (PostgreSQL)
Medium
Tables queried without indexes
N+1 Query
High
Repeated query patterns from ORM loops
Large SELECT
Low
SELECT * usage
Missing MySQL Index
Medium
MySQL tables queried without indexes
MySQL Full Table Scan
High
Full table scan patterns in MySQL queries
Missing Mongo Index
Medium
Collections queried without secondary indexes
Collection Scan
High
find() calls without filter predicates
Pipeline: scan in consumer
High / Verify
Full scan inside an event-triggered Lambda handler (High when the lambda-to-code link is IaC-proven, Verify when name-matched)
Pipeline: repeated table access
Medium / Verify
Same table read by 2+ functions in one service pipeline
Pipeline: missing DLQ hop
Medium
Mid-pipeline queue (has producer and consumer) with no Dead Letter Queue
Projects in other languages still get full value from infrastructure-level analyzers โ code correlation (function-to-table mapping, N+1 patterns) currently supports TypeScript, JavaScript, and Python.
The scanner supports: AWS SDK v3/v2 for DynamoDB, pg/Prisma/Knex for PostgreSQL, mysql2/Knex for MySQL, driver/Mongoose for MongoDB, AWS SDK v3 for SQS/SNS/SSM/Secrets/Lambda, and kafkajs for Kafka topics (producer/consumer).
How it works
Infrawise scans your repository and infrastructure metadata
A graph engine maps services, schemas, indexes, and query patterns
Rule-based analyzers detect infrastructure and query anti-patterns
The resulting context is exposed through MCP
AI coding assistants query this context while generating code
Deterministic analysis
Infrawise does not use an LLM to analyze your infrastructure. All extraction and analysis are deterministic: AST parsing, schema introspection, rule-based analyzers, and graph correlation. LLMs are only consumers of the generated context through MCP.
Security
Read-only โ never writes to AWS or your database, never executes DDL
Local-first โ everything runs on your machine, nothing sent to external servers
No telemetry โ zero data collection
Credentials โ uses your existing AWS credential chain, never stored by infrawise
๐ Security & Project Naming Note
You might see this package flagged on certain supply-chain security scanners under "deceptive naming." This is a false positive triggered by automated tools because of the prefix "infra." This project is completely safe, independent, and unaffiliated with any commercial trademarks.
Code-level correlation supports TypeScript, JavaScript, and Python (Python requires python3 on PATH)
Dynamically constructed queries may not always be resolved statically
Runtime tracing is not yet implemented
Large monorepos may require future incremental analysis optimization
Roadmap
Feature roadmap is tracked in the Infrawise v1 project board. Feature requests and upvotes welcome.
Demo
Two demos run infrawise against real AWS APIs emulated locally in Docker, at zero cost and with no real AWS account.
demo/floci/ uses Floci, an MIT-licensed emulator that covers every service infrawise supports โ including CloudFront, API Gateway v2, RDS, Cognito, Kinesis, ElastiCache, and MSK. No auth token, no sign-up. Start here.
See CONTRIBUTING.md for a full walkthrough โ including how to add a new service adapter, a new analyzer, and the PR checklist.
Releasing
Before releasing, run pnpm check:docs โ it fails if the version or the MCP tool list in README.md/AGENTS.md/llms.txt drifted from src/server/index.ts.
bash
pnpm release patch # 0.1.2 โ 0.1.3 (bug fixes)
pnpm release minor # 0.1.2 โ 0.2.0 (new features, backwards compatible)
pnpm release major # 0.1.2 โ 1.0.0 (breaking changes)
pnpm release 1.5.0 # explicit version
Bumps package.json, commits, tags, pushes, and creates a draft GitHub release with notes from commit messages. Then publish the draft on GitHub to trigger npm publish.