AI Agent Integration
SGD provides governance context to AI coding agents through two channels: a static CLAUDE.md file generated per repository, and a real-time MCP server that agents can query during development.
The result: AI agents consult your governance model instead of guessing.
Two channels, one goal
| Channel | Type | When it is used | What it provides |
|---|---|---|---|
| CLAUDE.md | Static file, committed to repo | Every time an agent opens the repository | Baseline context: change protocol, capability map, design constraints, key dependencies |
| MCP Server | Real-time API | During active development, when the agent needs specifics | Live data: current specs, impact analysis, coherence scores, design system rules |
Both channels complement each other. CLAUDE.md gives the agent the "always true" context without needing a network call. The MCP server gives it the "right now" context that changes as specs are updated and scores evolve.
Channel 1: CLAUDE.md (Static Context)
SGD auto-generates and maintains a CLAUDE.md file in the root of every governed repository. This file is committed to the repository, so it is available to any AI agent that reads the codebase — no configuration required.
What CLAUDE.md contains
The generated file includes four sections:
1. Change Protocol
## Change Protocol
- All feature work must reference a specification (e.g., `Refs: PAY-REFUND-001`)
- PRs are checked against the SGD governance model
- Design system rules are enforced for .tsx/.jsx changes2. Capability Map
## This Repository in Context
- Capability: Payment Processing
- Sibling repos: payment-gateway, billing-service, payment-types
- Upstream: auth-api (authentication)
- Downstream: reporting-service (consumes payment events)3. Design Constraints
## Design Constraints
- UI components: import from @acme/ui (canonical library)
- No inline styles in .tsx files
- Colours must use design tokens (var(--color-*))
- API responses must follow the shared response envelope4. Key Dependencies
## Key Dependencies
- @acme/ui v3.2.0 — shared component library
- @acme/api-types v1.8.0 — shared API type definitions
- DataTable component — used by 4 features across 4 reposHow it stays current
SGD regenerates CLAUDE.md when:
- The capability model changes (repo reassigned, new sibling added)
- Design system rules are updated
- A new feature spec is created that affects this repository
- The dependency graph changes significantly
The regeneration creates a commit on the default branch. If you prefer, you can configure SGD to open a PR instead.
Works without MCP
Even if your AI tooling does not support MCP, CLAUDE.md provides governance context. Claude Code, Cursor, and GitHub Copilot all read CLAUDE.md files automatically. This is the zero-configuration path to governed AI development.
Channel 2: MCP Server (Real-Time Context)
For AI agents that support the Model Context Protocol, SGD exposes an MCP server with five tools. These give the agent real-time access to governance data during active development.
MCP tools
| Tool | Description | Example use case |
|---|---|---|
get_capability_model | Returns the full capability model for the organisation, or a subtree for a specific capability | Agent needs to understand where this repo fits in the wider system |
get_feature_spec | Returns a specific feature specification by ID, including acceptance criteria and affected repos | Agent is implementing PAY-REFUND-001 and needs the full spec |
get_design_system | Returns the active design system rules for this repository, including canonical components and banned patterns | Agent is writing a React component and needs to know which imports to use |
get_impact_analysis | Returns the impact graph for a given component, endpoint, or spec — what depends on it and what would be affected by a change | Agent is modifying a shared component and wants to understand the blast radius |
get_coherence_score | Returns the current coherence score and dimension breakdown for a repository or capability | Agent wants to understand the current governance posture before making changes |
Example: agent writing a new feature
Here is how an AI agent uses both channels when implementing a feature:
Agent opens the repo — Reads
CLAUDE.md, learns this is therefund-processorrepo in the Payment Processing capability, governed by SGDAgent reads the spec — Calls
get_feature_spec("PAY-REFUND-001")to get the full specification, acceptance criteria, and list of affected filesAgent checks design rules — Calls
get_design_system()to learn thatButtonmust come from@acme/uiand inline styles are bannedAgent checks impact — Before modifying the shared
RefundStatuscomponent, callsget_impact_analysis("RefundStatus")to see that 2 other repos depend on itAgent writes the code — With full context, the agent produces code that follows the spec, uses canonical components, and includes
Refs: PAY-REFUND-001in the commit messagePR passes governance checks — Because the agent had the right context, the PR passes spec traceability and design system checks on the first try
Configuring the MCP server
Add the SGD MCP server to your AI agent's configuration:
{
"mcpServers": {
"sgd": {
"url": "https://api.sgd-platform.com/mcp",
"headers": {
"Authorization": "Bearer ${SGD_TOKEN}"
}
}
}
}The token is generated in the SGD dashboard under Settings > API Access. It is scoped to your organisation and respects the same permission model as the dashboard.
The result
Without SGD integration, AI agents make reasonable guesses based on the code they can see. They import the wrong component library, miss design constraints, create PRs without spec references, and modify shared components without understanding the blast radius.
With SGD integration, AI agents operate with the same context as a senior developer who has been on the team for years:
| Without SGD | With SGD |
|---|---|
Agent imports a local Button component | Agent imports Button from @acme/ui |
| Agent creates a PR with no spec reference | Agent includes Refs: PAY-REFUND-001 |
| Agent modifies shared component without checking impact | Agent calls get_impact_analysis first |
| Agent uses hardcoded colours | Agent uses design tokens |
| PR fails governance checks, requires rework | PR passes on the first attempt |
The governance model is only as effective as its reach. By meeting AI agents where they work — in the repo and through MCP — SGD ensures that governed development is the default, not the exception.