convez.ai
PluginDevOps & InfraestruturaIntermediário
Sidd27

Infrawise — Análise de Infraestrutura com IA

Sidd27/infrawise

Infraestrutura determinística para assistentes de codificação com IA

Ver no GitHub
BomPluginScore · de 0 a 100

MCP server que fornece contexto determinístico de infraestrutura AWS ao Claude Code, analisando Lambda, DynamoDB, SQS, PostgreSQL, MongoDB e EventBridge. Substitui adivinhações por conhecimento preciso de schemas, índices, padrões de query e relacionamentos entre serviços.

Instalação

$npx convez-ai Sidd27/infrawise

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
22
Forks
5
Acompanhando
0
Saúde
57%
Último commit
há 2 dias
Versão
v1.0.1
Issues abertas
10
Contribuidores
2

Casos de uso

  • Geração de código seguro com conhecimento exato de tabelas e índices
  • Detecção automática de padrões custosos (table scans, queries sem índice)
  • Análise estática de dependências entre Lambda, DynamoDB e outras services AWS
  • Recomendações de otimização baseadas em contexto real da infraestrutura

Veredito

Ferramenta essencial para times que usam Claude Code em produção, eliminando suposições do LLM sobre infraestrutura real. Implementação sólida com cache inteligente e detecção de mudanças, mas requer setup inicial e estar no ecossistema AWS.

README

A tradução para o português deste README ainda está na fila.

Infrawise

npm version Publish to npm CI License: MIT infrawise MCP server

Understand your infrastructure, not just your code.

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.


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

npm install -g infrawise

or use without installing:

npx infrawise start --claude

Quick start

cd your-project
infrawise start --claude

That's it. Infrawise will:

  1. Ask a few questions and generate infrawise.yaml (first time only)
  2. Scan your AWS services, databases, and codebase
  3. Write .mcp.json so your editor auto-connects on every future launch
  4. Open Claude Code with all 15 MCP tools ready

Every time after:

claude    # no infrawise command needed — editor manages the connection

Analysis is cached for 24 hours. When the cache is stale, infrawise 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.

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)

infrawise start --claude

Writes .mcp.json to your project root and opens Claude Code. Claude Code reads .mcp.json automatically on every launch and manages the infrawise stdio process — no server to start, no ports to configure.

Cursor

infrawise start --cursor

Writes .cursor/mcp.json and opens Cursor. All 15 infrawise tools are available in Cursor's MCP panel.

Windsurf

infrawise start --windsurf

Writes to ~/.codeium/windsurf/mcp_config.json and opens Windsurf.

Any editor (no flag)

infrawise start

Writes .mcp.json and exits. Open whichever editor you prefer — point it at infrawise 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:

infrawise dev    # starts server at http://localhost:3000/mcp

Add to your editor's MCP config:

{
  "mcpServers": {
    "infrawise": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

MCP tools

ToolWhat it provides
get_infra_overviewComplete snapshot — all services, counts, and high-severity findings
get_graph_summaryFull infrastructure graph — all nodes, edges, and findings
analyze_functionIssues in a specific function — scans, missing indexes, N+1, trigger event shapes
suggest_gsiExact GSI config for a DynamoDB table + attribute
postgres_index_suggestionsExact CREATE INDEX SQL for your actual table
suggest_mongo_indexExact createIndex command for a MongoDB collection + field
mysql_index_suggestionsExact ALTER TABLE ADD INDEX SQL for your MySQL table
get_queue_detailsSQS queues — DLQ status, encryption, message counts
get_topic_detailsSNS topics — subscription counts, protocols, and filter policies (required message attributes per subscription)
get_secrets_overviewSecrets Manager — names and rotation status (values never included)
get_parameter_overviewSSM Parameter Store — names, types, tiers (values never included)
get_lambda_overviewLambda functions — runtime, memory, timeout, triggers (SQS/DynamoDB/Kinesis/EventBridge/S3), env var key names
get_eventbridge_detailsEventBridge rules — name, state, schedule/event pattern, target functions
get_s3_overviewS3 buckets — versioning, encryption, public access, event notifications
get_log_errorsCloudWatch error patterns and counts (no raw log messages)

CLI reference

CommandWhat it does
infrawise startPrimary command — init + analyze + write editor MCP config, then exit
infrawise start --claudeSame as above, then opens Claude Code
infrawise start --cursorSame as above, then opens Cursor
infrawise start --windsurfSame as above, then opens Windsurf
infrawise initGenerate infrawise.yaml only (no analysis, no editor config)
infrawise authSelect or switch AWS profile
infrawise analyzeForce a full re-scan — useful after major infrastructure changes
infrawise devHTTP transport alternative — starts server at localhost:3000/mcp
infrawise stdioStdio transport — auto-managed by editors via .mcp.json (rarely run directly)
infrawise doctorValidate AWS access, DB connectivity, and config

infrawise analyze options

FlagDescription
-c, --config <path>Path to infrawise.yaml (default: infrawise.yaml)
-r, --repo <path>Repository to scan (default: current directory)
--no-cacheSkip reading/writing the cache
-o, --output <path>Save findings as a markdown report, e.g. report.md
--severity <level>Only show findings at or above this level: high | medium | low | verify
# 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

Configuration

infrawise.yaml is generated by infrawise start (or infrawise init to create the file only) 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:

postgres:
  enabled: true
  connectionString: postgresql://infrawise_ro:${DB_PASSWORD}@host:5432/mydb

Full example:

project: payments-service

aws:
  profile: default # AWS profile from ~/.aws/credentials
  region: ap-south-1

dynamodb:
  enabled: true
  includeTables: # omit to include all tables
    - Orders
    - Users

postgres:
  enabled: true
  connectionString: postgresql://infrawise_ro:${DB_PASSWORD}@host:5432/mydb

mysql:
  enabled: false
  connectionString: ''

mongodb:
  enabled: false
  connectionString: ''

sqs:
  enabled: true

sns:
  enabled: true

ssm:
  enabled: true
  paths: [] # filter by prefix e.g. ["/myapp/prod"]

secretsManager:
  enabled: true

lambda:
  enabled: true
  includeFunctions: # omit to include all functions
    - myFunction
    - anotherFunction

eventbridge:
  enabled: true

rds:
  enabled: false

s3:
  enabled: false

kafka:
  enabled: false

cloudwatchLogs:
  enabled: false
  logGroupPrefixes: []
  windowHours: 24

analysis:
  sampleSize: 100

AWS setup

Infrawise is read-only. Minimum IAM policy required:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["dynamodb:ListTables", "dynamodb:DescribeTable"],
      "Resource": "*"
    }
  ]
}

For SSO profiles, log in before running infrawise:

aws sso login --profile myprofile

PostgreSQL setup (optional)

Create a read-only user for infrawise:

CREATE USER infrawise_ro WITH PASSWORD 'yourpassword';
GRANT CONNECT ON DATABASE yourdb TO infrawise_ro;
GRANT USAGE ON SCHEMA public TO infrawise_ro;
GRANT SELECT ON ALL 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:

ServiceWhat it checks
DynamoDB schemaTables, GSIs, partition keys
PostgreSQL / MySQL schemaTables, indexes, column types
MongoDB schemaCollections, indexes
SQSMissing DLQs, unencrypted queues, large backlogs
SNSSubscription filter policies — required message attributes per subscription
Kafka (kafkajs)Producer/consumer topic mapping from code
Secrets ManagerMissing secret rotation
LambdaDefault memory (128 MB), high timeouts, triggers (SQS/DynamoDB/Kinesis/EventBridge/S3), missing DLQ on trigger source
S3Public access blocking (verify), missing versioning, missing encryption
EventBridgeRules, schedules, event patterns, target Lambda functions
RDSPublicly accessible, no backups, unencrypted, no deletion protection, single-AZ
CloudWatch LogsLog groups with no retention policy
Terraform / CloudFormation / CDKIaC drift vs deployed state

Code correlation analysis (TypeScript / JavaScript)

Uses ts-morph AST analysis to detect which functions call which tables and how:

AnalyzerSeverityWhat it detects
Full Table Scan (DynamoDB)High.scan() calls without filters
Missing GSIMediumQueries on attributes without a matching GSI
Hot PartitionMedium5+ distinct code paths hitting the same table
Missing Index (PostgreSQL)MediumTables queried without indexes
N+1 QueryMediumRepeated query patterns from ORM loops
Large SELECTLowSELECT * usage
Missing MySQL IndexMediumMySQL tables queried without indexes
MySQL Full Table ScanHighFull table scan patterns in MySQL queries
Missing Mongo IndexMediumCollections queried without secondary indexes
Collection ScanHighfind() calls without filter predicates

Non-TypeScript/JavaScript projects still get full value from infrastructure-level analyzers — code correlation (function-to-table mapping, N+1 patterns) is skipped.

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

  1. Infrawise scans your repository and infrastructure metadata
  2. A graph engine maps services, schemas, indexes, and query patterns
  3. Rule-based analyzers detect infrastructure and query anti-patterns
  4. The resulting context is exposed through MCP
  5. 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

Architecture overview

Architecture

Source layout

src/
  types.ts      Shared type definitions
  core/         Config (Zod + YAML), logger (Pino), local cache
  graph/        Graph engine — nodes, edges, builder
  adapters/
    aws/        DynamoDB, Lambda, SQS/SNS/SSM/Secrets/EventBridge/RDS, CloudWatch
    db/         PostgreSQL, MySQL, MongoDB
    iac/        Terraform, CDK, CloudFormation (local file parsing)
  analyzers/    23 rule-based analyzers
  context/      Repository scanner (ts-morph AST)
  server/       Fastify MCP server (@modelcontextprotocol/sdk, Streamable HTTP)
  cli/          CLI commands (Commander.js)

Current limitations

  • Code-level correlation supports TypeScript and JavaScript only
  • 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 GitHub Project. Feature requests and upvotes welcome.


Demo

The demo/localstack/ directory runs infrawise against real AWS APIs emulated locally via LocalStack — an open-source tool that spins up a full AWS environment in Docker so you can test AWS integrations at zero cost, with no real AWS account needed. See demo/localstack/README.md for setup instructions.


Contributing

See CONTRIBUTING.md for a full walkthrough — including how to add a new service adapter, a new analyzer, and the PR checklist.

Releasing

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.


License

MIT

Ver o original no GitHub

Bom para

Relacionados