Software Development

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

LinkedIn has successfully deployed an internal organizational context layer powered by the Model Context Protocol (MCP) to address the limitations of early AI coding assistants. Presented by LinkedIn software engineer Ajay Prakash, the initiative has scaled to over 8,000 daily users across engineering, product management, design, and technical program management, automating more than 600 complex workflows. This architectural approach successfully resolves the notorious "vibe coding" bottleneck—where AI agents hallucinate or produce subpar code due to a lack of institutional knowledge—by blending custom tools, programmatic procedural memory, and strict design philosophies into a cohesive enterprise framework.

The Evolution of Vibe Coding and the Context Wall

When early AI coding assistants transitioned from intelligent autocomplete functions to autonomous agent modes equipped with terminal execution and file-editing capabilities, the software industry experienced a surge of excitement. Coined as "vibe coding" by Andrej Karpathy in early 2025, the paradigm promised a future where engineers could bypass manual syntax writing, orchestrating software development purely through natural language prompts while agents independently handled testing and implementation.

However, when engineering teams at LinkedIn integrated these cutting-edge agents directly into their mature codebase, the results fell short of expectations. LinkedIn’s technological ecosystem is exceptionally massive, consisting of thousands of repositories, interdependent microservices, proprietary internal frameworks, and custom infrastructure built to sustain global-scale traffic. New human engineers typically require an intensive one-week bootcamp followed by several weeks of ramp-up time merely to comprehend the internal architecture.

Unsurprisingly, standard AI models trained primarily on open-source codebases struggled to navigate this complex environment. Lacking access to LinkedIn’s institutional nuances, the agents produced erroneous code, hallucinated solutions, and required exhaustive human oversight. Rather than saving time, developers found themselves babysitting the technology, prompting many to revert to traditional manual coding to meet strict delivery deadlines.

Integration of the Model Context Protocol and Code Search

The turning point for LinkedIn arrived with Anthropic’s release and open-sourcing of the Model Context Protocol (MCP). Emerging as an open standard for connecting external tools to language models, MCP provided the exact bridge LinkedIn needed to extend AI capabilities into its proprietary infrastructure.

LinkedIn’s engineering division immediately leveraged MCP to wrap existing internal systems, starting with a sophisticated code search engine. Ingesting code across more than 1,000 repositories, the search engine allows agents to execute keyword, regex, and advanced filter queries to retrieve relevant code snippets and file contents dynamically. By granting coding agents the ability to query real enterprise implementations rather than relying solely on pre-trained public data, the platform unlocked a foundational level of code comprehension.

Following code search, LinkedIn systematically expanded the MCP ecosystem to encompass internal documentation, wikis, product requirement documents, architecture guides, feature flags, task management boards, and data platforms. Despite this influx of data, however, end-to-end execution of complex tasks remained elusive due to three primary systemic roadblocks: tribal knowledge, context overload, and a lack of long-term memory.

Overcoming Tribal Knowledge and Context Overload

While data accessibility improved, complex engineering tasks rely heavily on scattered tribal knowledge—nuanced procedures regarding dependency installation, compilation commands, and deployment verification that typically reside exclusively within the minds of senior engineers or fragmented Slack threads.

Simultaneously, the platform encountered the severe challenge of context overload. As agents executed multiple tool calls to gather information, the raw output rapidly consumed the large language model’s limited context window. When the window filled up, internal compaction algorithms systematically compressed the data, frequently erasing critical context and forcing agents into unproductive loops where they repeated previous tool calls from scratch. Furthermore, the absence of durable long-term memory meant that identical tasks required costly, time-consuming rediscovery every single time an engineer initiated a request.

To combat these hurdles, LinkedIn introduced the concept of procedural memory via structured "playbooks."

Procedural Memory: Playbooks and Architectural Design

Defining procedural memory as the contextual blueprint for executing specific operations, LinkedIn engineered a playbook system distributed through their local MCP server. Playbooks consist of standardized names, descriptions, and discrete instructions, allowing coding agents to invoke them as regular tools whenever an associated task is requested. For instance, an engineer asking an agent to establish an Apache Airflow offline pipeline triggers the execution of the Airflow playbook, instantly loading the precise contextual parameters required for success.

To maintain scalability and reliability, LinkedIn enforces two core design philosophies for playbook authoring:

  1. Self-Containment: Each playbook must address precisely one specific task, preventing cognitive bloat and ensuring clarity.
  2. Composability: Complex workflows are broken down into smaller, modular playbooks that can be referenced hierarchically by larger parent playbooks.

This composability achieves progressive disclosure of context. Rather than forcing an agent to ingest an entire massive library of instructions simultaneously, the system allows the LLM to selectively read smaller modular playbooks only when necessary. This architecture effectively constructs an organizational context graph that agents navigate dynamically to execute long-running operations.

Furthermore, LinkedIn built self-improving feedback loops directly into the architecture. When an agent encounters outdated instructions or unexpected edge cases during playbook execution, it improvises using available tools, flags the discrepancy, and summarizes the learnings at the end of the session. Background automation jobs subsequently update the master playbooks, ensuring the procedural memory continuously evolves and improves through regular usage.

Infrastructure and Security Framework

From an infrastructure perspective, LinkedIn deployed a local MCP server directly onto all employee laptops, with automated hourly updates ensuring rapid global deployment of newly authored tools and playbooks. The server natively distinguishes between central playbooks (applicable across the entire enterprise) and local repository-specific playbooks stored directly within workspace directories.

Security remains a paramount priority. Every integrated tool requires authentication managed via a seamless OAuth library that stores tokens securely in local keychains for automatic token refreshing. Crucially, every newly introduced tool must pass rigorous Information Security (InfoSec) audits before deployment, mitigating potential vulnerabilities associated with expanding AI agent capabilities.

To prevent performance degradation caused by exposing more than 30 direct tools to a single LLM context window, LinkedIn implemented an intelligent search intermediary. Instead of loading thousands of tools directly, the agent utilizes a centralized search tool based on domain tags and action descriptions to query the tool catalog dynamically, retrieving only the required schema and arguments on demand.

Enterprise Adoption and Quantitative Impact

With over 8,000 active daily users spanning software engineering, product management, design, and technical program management, LinkedIn’s MCP deployment has redefined corporate productivity. Data gathered over several months of operation highlights five primary categories of playbook utilization:

  • Debugging and Incident Investigation: Teams have converted complex operational runbooks into playbooks, allowing agents to ingest metrics, logs, and deployment histories to isolate root causes during high-severity latency spikes.
  • Boilerplate Code Generation: Agents handle repetitive internal framework setups and database initializations, freeing human developers to focus on product architecture and feature innovation.
  • Code Cleanups and Migrations: Automated execution of mandatory enterprise migrations drastically reduces developer tax and accelerates codebase modernization.
  • Infrastructure and Pipeline Management: Long-running offline data pipelines and AI training jobs are delegated to agents equipped with specific operational instructions.
  • Environment and Repository Setup: New engineers utilize playbooks to configure local development environments rapidly, shortening onboarding timelines significantly.

According to internal performance tracking, the platform has delivered a measurable 20% increase in overall engineering productivity. Crucially, this velocity gain has been achieved without compromising system reliability, as strict quality guardrails enforced from day one have kept downstream error rates completely stable.

Future Outlook and Strategic Implications

Looking ahead, LinkedIn is actively developing background autonomous agents designed to parse pull request histories, agent telemetry, and session logs automatically. These background agents will identify repeatable workflows and independently author new playbooks or patch outdated instructions without human intervention, scaling the organizational context layer organically.

Industry analysts observe that LinkedIn’s implementation offers a vital blueprint for enterprise AI adoption. As foundational models and hardware harnesses continue to evolve rapidly, the persistent differentiator for corporate artificial intelligence remains proprietary internal context. By establishing a robust, secure, and composable infrastructural layer for tribal knowledge, organizations can successfully transition AI assistants from speculative novelties into indispensable enterprise coworkers.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button