Skip to main content

What You’ll Learn

Practical integration workflows combining MCP servers and rules for real-world development scenarios.

Integration Methods

MethodBest ForConfiguration
MCP ServersExternal tools, databases, APIsSettings → MCP Servers
Rules (AGENTS.md)Team standards and behaviorProject root AGENTS.md
User RulesPersonal preferencesSettings → User Rules
Philosophy: Combine methods to create comprehensive workflows tailored to your needs.

MCP Configuration

Understanding MCP

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. MCP servers are executables that implement the protocol—they’re not database connections or API endpoints, but programs that run and communicate via JSON-RPC 2.0. Key Concepts:
  • MCP Servers: Executables (Node.js packages, Python scripts, etc.) that implement the MCP protocol
  • Configuration: Settings → MCP Servers defines how to start each server
  • @-Mentions: Custom MCP servers can be invoked using @-mentions (e.g., @migration-reviewer)

Basic Setup

Location: Settings → MCP Servers Configure MCP servers with:
  • Command: Executable to run (typically npx for Node.js packages)
  • Args: Arguments passed to the command (package name, connection strings, etc.)
  • Env: Environment variables for authentication/configuration
Common MCP Servers:
ServerPurpose
@modelcontextprotocol/server-postgresPostgreSQL database access
@modelcontextprotocol/server-githubGitHub repository integration
@modelcontextprotocol/server-filesystemFile system operations
Learn More About MCP:

Common Integration Patterns

Database Development Workflow

Stack: Migration Reviewer MCP + AGENTS.md Standards + PostgreSQL MCP Server Custom MCP Server: Create an MCP server for migration review that checks:
  • Destructive operations
  • Reversibility
  • Indexing requirements
  • Blocking operations
AGENTS.md:
## Database Standards
- All migrations reviewed by @migration-reviewer
- Test on staging before production
- Include rollback procedures
Workflow: Write migration → @migration-reviewer validates → PostgreSQL MCP tests on staging → PR documentation

API Development with Security

Stack: Security Auditor MCP + AGENTS.md Rules + API Testing MCP Components:
  • MCP Server: @api-security-auditor - Input validation, SQL injection, auth, rate limiting
  • Rules: All endpoints require security review, rate limiting on public APIs
Result: Automatic security review before PR approval.

Frontend Accessibility

Stack: Accessibility Auditor MCP + WCAG Rules Workflow:
Create component → @a11y-auditor reviews → Rules enforce accessibility standards

Multi-Environment Configuration

Configure multiple MCP servers for different environments in Settings → MCP Servers:
Server NamePurpose
postgres-devDevelopment database
postgres-stagingStaging environment
postgres-prodProduction (read-only recommended)
Best Practice: Use environment variables for connection strings to keep credentials secure.

Workspace Integration

Per-Workspace Configuration

Each workspace can use the same MCP servers configured in Settings:
ConfigurationBehavior
Global MCP serversAvailable across all workspaces
Project-specific rulesAGENTS.md in project root

Multi-Project Integration

When working with multiple projects:
  • Global MCP servers (Settings → MCP Servers) available across all projects
  • Each project can have its own AGENTS.md for project-specific rules
  • Switch between projects while maintaining MCP access

Team Collaboration

Shared AGENTS.md Standards

Commit to version control for team-wide consistency:
# AGENTS.md

## Code Review Process
- Run Code Review before PR (Settings → Auto Generate Code Review)
- Address all security warnings
- Minimum 80% test coverage

## Integration Requirements
- @migration-reviewer for database changes
- @api-security-auditor for new endpoints
- @a11y-auditor for UI components

## MCP Server Usage
- Use postgres-staging for queries
- Never use postgres-prod for exploratory queries
Benefits: Consistent behavior, enforced standards, automatic quality gates.

Multi-Agent Coordination

Complex Feature Workflow

Example: New payment endpoint
1. Developer request → 2. Main agent generates code →
3. @api-security-auditor reviews security →
4. @migration-reviewer validates schema →
5. MCP tests on staging →
6. Main agent generates tests and PR
Result: Fully reviewed endpoint with security and database best practices applied.

Integration Best Practices

Progressive Adoption

Phase 1: Basic rules
## Code Standards
- Use TypeScript strict mode
- Run tests before commit
Phase 2: Add specialized MCP servers
## Code Review
- Run @security-reviewer before PR
Phase 3: Integrate more MCP servers
## Database Access
- Use postgres-staging MCP for queries

Strategic Combinations

CombinationPurposeExample
Rules + MCPRules define when, MCP executesAGENTS.md: “Review with @security-reviewer”
Multiple MCPsDifferent servers for different concernsSecurity + Database + API testing

Team Documentation Best Practices

When documenting integrations for your team, include:
  • MCP Servers: Describe each server’s purpose, access level, and when to use it
  • AGENTS.md Rules: Document rules with rationale explaining the “why” behind each standard
  • Integration Workflows: Provide example workflows showing how components work together
  • Troubleshooting: Document common issues specific to your setup and their solutions
Commit integration documentation alongside your AGENTS.md file so new team members can quickly understand your setup.

Troubleshooting

Problem: AGENTS.md rules not being appliedCheck:
  • Location: File is in project root directory
  • Syntax: Valid Markdown with no parsing errors
  • Directive Style: Use specific commands (“Always use…” not “Try to…”)
  • Session: Start new conversation to test fresh rule application

See Also