๐ PostgreSQL MCP
The PostgreSQL MCP connects the agent to Postgres databases via a connection string. Tools: query (run SQL), list_tables, describe_table. The agent can analyze schemas, generate reports, debug data, and even suggest indexes.
The configuration passes the connection string as an environment variable: POSTGRES_URL=postgresql://user:pass@host:5432/db. Always prefer read-only access for production environments.
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": { "POSTGRES_URL": "postgresql://user:pass@localhost:5432/mydb" }
}In one sentence: PostgreSQL MCP = the agent runs SQL queries on real Postgres databases.
โก Redis MCP
The Redis MCP exposes cache and key-value operations: get, set, keys, ttl, del. Useful for debugging cache, checking queues, and monitoring application status in real time.
Connection via REDIS_URL: redis://localhost:6379. The agent can inspect keys, check TTLs, and even clear the cache on demand.
In one sentence: Redis MCP = inspect and operate Redis caches/queues through an agent.
๐ HTTP/REST MCP
The HTTP MCP is a generic connector for any REST API. You configure the base URL and auth headers, and the agent can make GET, POST, PUT, and DELETE requests to any endpoint. It's the Swiss Army knife of MCPs.
Each operation becomes a tool with parameters for path, query params, headers, and body. Ideal for connecting internal services that don't have a dedicated MCP.
In one sentence: HTTP MCP = connect the agent to any REST API with a config.
โ GraphQL MCP
If your API is GraphQL, this MCP lets you run queries and mutations directly. The agent uses introspection to understand the schema and automatically build appropriate queries.
The configuration needs the GraphQL endpoint and optionally auth headers. The agent can explore the schema, list types, and run complex operations with variables.
In one sentence: GraphQL MCP = GraphQL queries and mutations via the agent, with schema introspection.
๐ Connecting to Real Services
Connecting MCPs to local services is easy. The challenge is connecting to real-world environments: staging, production. Common patterns: SSH tunnels for remote databases, project-specific env configs (local vs. global settings.json), and connection pools to avoid overload.
Golden rule: never give production write access via MCP without supervision. Use read-only for queries and analysis; use write only in staging or with an approval flow.
Never write directly to prod
The agent can execute DELETE or DROP without a second thought. Production environments should be read-only via MCP. Write only with approval or in staging.
In one sentence: connecting to staging/prod = SSH tunnel + read-only + per-project env.
๐ Credential Security
MCPs with access to DBs and APIs need credentials: connection strings, tokens, passwords. These credentials are stored in settings.json or environment variables. The risk: if settings.json is committed to git, the credentials leak.
Best practices: (1) use env in settings.json instead of hardcoding in the args, (2) add .claude/settings.json to .gitignore, (3) for teams, use a secret manager and reference shell variables.
# Never commit settings with credentials .claude/settings.json .env .env.local
In one sentence: credentials in env vars + gitignore + secret manager = basic security.
๐งพ Module Summary
Next module:
3.5 โ Create Your Own MCP Server: from scratch to deployment.