Context engineering
Context engineering is the practice of structuring and managing AI context to make it reliable, reusable, and maintainable. The Model Context Protocol (MCP) provides an open standard for how tools fetch context from servers.
The Model Context Protocol (MCP)
Section titled “The Model Context Protocol (MCP)”MCP is an open standard that defines how AI tools securely fetch context from servers. It separates context management from tool usage, enabling teams to maintain a single source of truth that works across different tools.
Core MCP concepts
Section titled “Core MCP concepts”Prompts (/instructions)
- Dynamic prompt templates that accept arguments
- Use
$argumentsfor user input - Use
@referencesto pull in static knowledge - Must include metadata (name, description) for tool discovery
Resources (@knowledge)
- Static reference material (API specs, schemas, guides)
- Served as-is without dynamic properties
- Referenced by prompts using
@knowledgeFilesyntax - Provide the “source truth” for AI accuracy
Libraries
- Collections of prompts and resources
- Organised by project, team, or purpose
- Published as a unit to MCP endpoints
- Accessible to any MCP-compatible tool
Context engineering principles
Section titled “Context engineering principles”1. Separation of static and dynamic content
Section titled “1. Separation of static and dynamic content”Static reference material (@knowledge) should be separate from dynamic prompts (/instructions). This allows you to update schemas or guides in one place without rewriting prompts.
Example: An API schema lives in @api-schema.md. Multiple /instructions reference it using @api-schema, so all prompts use the same up-to-date schema.
2. Explicit dependencies
Section titled “2. Explicit dependencies”Use @references to make dependencies explicit. When a prompt references knowledge, that relationship is clear and validated before publishing.
Example: Generate a component using @Frontend-Style-Guide makes it explicit that this prompt depends on the style guide.
3. Version control through publishing
Section titled “3. Version control through publishing”MCP implementations use a Draft/Published workflow. Drafts allow safe iteration while Published versions remain stable for your team.
- Draft: Private, editable, not available to tools
- Published: Stable, available to all connected tools, replaces previous Published version
This way you never break working prompts your team relies on.
4. Metadata requirements
Section titled “4. Metadata requirements”MCP requires metadata for discovery and usability:
- Descriptions: Human-readable explanations of what prompts do and what arguments mean
- Argument types: Whether inputs are required or optional
- Reference validation: All
@referencesmust resolve to existing resources
Without proper metadata, tools cannot present prompts effectively to users.
5. One place for everything
Section titled “5. One place for everything”Context libraries centralise knowledge that would otherwise be scattered across files, wikis, and conversations. Update once and it propagates to all tools using that library.
Why MCP matters
Section titled “Why MCP matters”Before MCP, teams had to build custom integrations for each tool, maintain context in multiple places, and manually sync updates across systems.
MCP changes that by providing one protocol that works across tools. Context is fetched on-demand from a central source and available everywhere.
Next Steps
Section titled “Next Steps”Learn about /instructions, @knowledge, and libraries to start building context libraries.