Context Engineering at LinkedIn: How We Built an Organizational Context Layer for AI Agents with MCP

The rapid evolution of artificial intelligence in software development has shifted the industry’s focus from simple code completion to autonomous agentic workflows. However, for large-scale enterprises like LinkedIn, the transition to AI-assisted engineering has faced significant hurdles, primarily due to the vast complexity of internal systems and the limitations of "vibe coding." To bridge this gap, LinkedIn engineers have implemented a sophisticated architectural layer known as Contextual Agent Playbooks and Tools, leveraging the Model Context Protocol (MCP) to transform AI agents from general-purpose assistants into domain-aware coworkers capable of navigating a massive, interconnected technical stack.
The Failure of Generic AI Coding Assistants
In early 2025, the industry witnessed a surge of interest in "vibe coding"—a paradigm popularized by Andrej Karpathy where developers could generate functional software through natural language prompts without directly manipulating the source code. While the promise of increased developer velocity was substantial, LinkedIn’s initial attempts to integrate these agents into their production environment proved unsuccessful.
LinkedIn’s engineering stack consists of thousands of repositories, complex microservices, and proprietary frameworks for observability, experimentation, and database management. The primary issue was not the model’s ability to write code, but its lack of "organizational context." Generic LLMs are trained on vast swaths of open-source data, but they remain ignorant of LinkedIn’s specific internal architectural patterns, custom infrastructure, and tribal knowledge. When deployed, these agents often hallucinated, produced subpar results, or struggled with the high-reliability standards required for a platform serving millions of users. Consequently, engineers found themselves "babysitting" the agents, leading many to revert to manual coding to meet strict deployment deadlines.
Introducing the Model Context Protocol (MCP)
The turning point for LinkedIn’s AI strategy arrived with the introduction and open-sourcing of the Model Context Protocol (MCP) by Anthropic. MCP provided a standardized, interoperable bridge between AI agents and local or remote data sources. By adopting this protocol, LinkedIn’s infrastructure team began building a centralized system to feed internal context directly into coding agents.
The integration began with the wrapping of LinkedIn’s sophisticated code search engine. By connecting this tool through MCP, the agents were no longer restricted to their pre-trained parameters. Instead, they gained the ability to query real-time, proprietary codebases. This was followed by the integration of documentation, wikis, feature flags, and task management systems. Despite this newfound access to data, the agents still struggled with complex, end-to-end tasks, often succumbing to "context overload"—a phenomenon where excessive tool output exhausts the LLM’s limited context window, leading to repetitive loops or information loss during data compaction.
Scaling Through Procedural Memory: Playbooks
To solve the problems of context window constraints and the lack of long-term memory, LinkedIn developed "Playbooks." Conceptually similar to the agent skills framework, Playbooks serve as a form of procedural memory. They encapsulate the "how-to" knowledge for specific tasks—such as debugging a latency spike or setting up an Airflow pipeline—within a structured, reusable format containing a title, description, and execution instructions.
The system adheres to two critical design philosophies:
- Self-Containment: Each Playbook must perform one specific task to ensure clarity and reduce the likelihood of logic errors.
- Composability: Larger, more complex workflows are built by chaining smaller, modular Playbooks. This enables "progressive disclosure of context," where the agent only retrieves the necessary information for a specific sub-task, thereby keeping the context window lean and performant.
This architecture has allowed LinkedIn to move beyond manual coding. The system now supports over 600 unique Playbooks and thousands of tools, with more than 8,000 active users, including not only software engineers but also product managers and technical program managers.
Architecture and Security Governance
LinkedIn’s implementation features a local MCP server pre-installed on every developer laptop, ensuring that tools are readily available and auto-updated hourly. The system distinguishes between "Central Playbooks," applicable across the entire organization, and "Local Playbooks," which are specific to individual repositories and managed within the team’s local directory.
Security remains a primary concern for the organization. Every tool added to the MCP environment must pass a rigorous Information Security (InfoSec) review. To handle the scale of thousands of tools, the team implemented a discovery mechanism: instead of loading all tools at once, the system exposes a search function. When an agent needs to perform an action, it queries the tool catalog, retrieves the relevant schema, and then executes the specific function. This "just-in-time" retrieval ensures that agents remain performant, as they only interact with the 30 or fewer tools necessary for a given context.
Impact and Future Outlook
The shift toward agentic workflows has yielded measurable improvements in productivity. Internal data indicates a 20% increase in developer productivity since the full integration of the Playbook system. Notably, these gains have not come at the expense of system reliability; the platform’s high-availability standards have been maintained through automated verification steps built into the Playbooks themselves.
The most common use cases for these agents now include:
- Incident Management: Converting static runbooks into dynamic Playbooks that can ingest logs, metrics, and deployment history to diagnose root causes.
- Boilerplate Reduction: Automating the repetitive, manual setup of internal frameworks.
- Migration and Cleanup: Executing large-scale code migrations across dependent repositories.
- Environment Setup: Standardizing local development environments for new hires, significantly reducing onboarding time.
Looking ahead, LinkedIn is focusing on the "automation of automation." The current roadmap includes the development of background agents that analyze telemetry from PRs, incident sessions, and tool usage patterns to automatically suggest new Playbooks or identify outdated ones. This creates a self-improving "flywheel" where the organizational knowledge base evolves in tandem with the infrastructure.
Lessons for the Industry
The success at LinkedIn highlights three fundamental takeaways for enterprises navigating the AI transition. First, productivity cannot be measured by code generation speed alone; robust guardrails for quality and system reliability must be baked into the infrastructure from day one. Second, the technical challenge is less about the model and more about the "plumbing"—the ability to expose internal, tribal knowledge to the agent in a structured, accessible format.
Finally, developer experience is the ultimate arbiter of success. If an AI tool is cumbersome, confusing, or unreliable, engineers will ignore it. LinkedIn’s investment in a seamless, unified interface for these agents has been the primary driver of their adoption. As AI continues to redefine the software development lifecycle, LinkedIn’s "Context Engineering" model serves as a blueprint for large organizations looking to transform AI agents from speculative experiments into essential, high-trust partners in the engineering process.







