26.4 C
United States of America
Tuesday, May 20, 2025

MCP for DevOps – Collection Opener and MCP Structure Intro


MCP for DevOps – Collection Opener and MCP Structure Intro

You could have undoubtedly heard about Anthropic’s MCP (Mannequin Context Protocol) open supply challenge. If you happen to haven’t, I hope your trip on a distant island with out web entry was beautiful!

As a die-hard YouTube Premium fan, I’m inundated with video suggestions with themes like “What’s MCP?” “OMG, This Adjustments All the pieces,” and my favourite, “Goodbye Builders, MCP is Right here to Keep.” Critically? Whereas it’s a unbelievable challenge, it isn’t right here to exchange us.

Over the following a number of weeks, I’ll delve into these matters:

MCP—Why Ought to You Care?: This may present a quick overview of MCP from a communication, discovery, and interplay perspective. We are going to then discover what it appears like on the wire and the way it capabilities as a consumer/server structure, adopted by numerous use circumstances. I received’t cowl the historical past of MCP or different important info, as numerous wonderful assets can be found on YouTube, dev.to, Medium, and elsewhere.

MCP for DevOps: I’ll talk about a collection of use circumstances that work properly for DevOps, NetOps, and SecOps roles.

MCP How-to: That is the place issues get thrilling. I’ll current a number of demos and walk-throughs for the next use circumstances:

  • Cursor with GitHub: Use Cursor as an MCP consumer to programmatically work together with an MCP server that integrates with GitHub for a Cisco DevOps workflow
  • Cursor with Argo CD: Use Cursor as an MCP consumer to programmatically work together with an MCP server that employs Argo CD for a Cisco DevOps workflow
  • Claude Desktop & DevOps Workflows: We are going to change issues up by utilizing Claude Desktop as an alternative of Cursor to display flexibility on the MCP consumer aspect

On the finish of the collection, I’ll tie all of this collectively to point out how Cursor, with a number of MCP shoppers, can drive modifications to Ansible playbooks in a GitHub repository, triggering actions within the Argo CD workflow. In the end, we’ll use the Ansible playbook to switch configuration settings on Cisco options comparable to Cisco ISE (Id Companies Engine) and different Cisco merchandise.

I hope you be a part of me on this journey.

Let’s get began with discussing the MCP structure and why it is best to care about it.


MCP Intro—Why Ought to You Care?

Welcome to the primary publish in our three-part technical collection on Mannequin Context Protocol (MCP), a brand new, targeted protocol constructed to assist AI functions and brokers work together with instruments, APIs, recordsdata, and databases persistently and programmatically.

If you happen to’re in DevOps and experimenting with AI-driven automation, MCP deserves your consideration—not as a silver bullet however as a sensible step towards cleaner integration between AI programs and your operational stack. That stated, it’s early days. MCP is new and transferring quick, and whereas it already solves a variety of real-world issues, there are nonetheless corners to shine and edge circumstances it doesn’t but cowl.

What’s MCP, and Why Does It Matter?

As illustrated in Determine 1, Mannequin Context Protocol (MCP) is a protocol that gives a uniform strategy to plug in an AI mannequin into instruments and providers.

Determine 1. MCP with LLMs and Instruments

It’s:

  • A light-weight communication protocol designed particularly for AI brokers and functions.
  • Constructed to attach these brokers to instruments, APIs, databases, and file programs.
  • Structured as a consumer/server structure—easy and predictable.
  • Plumbing

It isn’t:

  • A messaging protocol for agent-to-agent communication.
  • An LLM, database, AI assistant or agent.
  • A general-purpose integration platform.
  • A substitute on your current APIs or information bus.

MCP’s job is tightly scoped: give an AI agent a clear, standardized strategy to uncover, request, and invoke capabilities on current tool-based infrastructure. In case your LLM-powered bot must name a REST API, checklist recordsdata, or question a database—MCP offers the glue.

MCP issues as a result of it reduces and, in lots of circumstances, removes the toil for AI functions and brokers to search out, connect with, and leverage exterior instruments and providers comparable to APIs, information sources, and different non-AI native device units. For Dev/Web/SecOps employees, it will probably carry rapid worth so that you can leverage an AI agent to connect with your current information sources and APIs in order that an operationally-focused agent can extra precisely full duties.

We are going to talk about use circumstances within the subsequent weblog, however think about you should create a workflow that works with Ansible Playbooks, NetBox, and GitHub and automate configurations towards your infrastructure.

An instance workflow might appear like this:

  • You manually create a Jinja2 template for Ansible and host it on GitHub.
  • Collect information out of your NetBox deployment.
  • You utilize Python + Jinja2 to populate the playbook template with information from NetBox after which invoke Ansible through a Python module, CLI, runner, and many others.
  • Ideally, you utilize a CI/CD device to auto-run this workflow.

Quick ahead from the great ’ole days; you or somebody in your group be taught in regards to the energy of AI Brokers and create a collection of AI brokers that may faucet into every device and information supply with out writing any code. They’ll leverage MCP to connect with every useful resource as MCP servers and work together with them natively—no particular script code. No scouring the web for SDKs or some mysterious script somebody recommends that you simply don’t perceive. To me, that is considered one of many value-add use circumstances of MCP.

Overview of MCP – Structure and Core Parts

MCP has a streamlined structure and there aren’t many transferring components.

As illustrated in Determine 2 MCP makes use of a consumer/server structure. Let’s outline what the consumer and server elements do.

Determine 2. MCP Parts

Determine 2 exhibits an MCP host which is an AI utility comparable to an AI agent, IDE, coding assistant, and many others..

The MCP consumer (MCP-C) is software program that runs on MCP hosts and has one-to-one connections to MCP servers (MCP-S).

The MCP server is software program that represents particular service or device capabilities.

The MCP host makes use of the language-specific MCP SDK for consumer connections (instance: MCP Python SDK) to ascertain connections to MCP servers. The MCP SDK is used for each client-side and server-side code.

Instance Python MCP consumer code.

Instance Python MCP server code.

Many present MCP shoppers are full functions or AI brokers with the MCP consumer SDK performance natively in-built. You possibly can see an instance checklist right here: https://modelcontextprotocol.io/shoppers

There are quite a few sources of MCP server lists on the Web. Here’s a checklist from the MCP challenge: https://modelcontextprotocol.io/examples. Some MCP consumer suppliers, comparable to Cursor, have their very own checklist of servers: https://cursor.listing/.

Determine 2 exhibits that every MCP-C occasion has a one-to-one connection to every MCP-S occasion. Within the determine, there are two MCP shoppers operating on the MCP host, an AI agent on this instance. The primary MCP consumer is connecting to a locally-hosted MCP server that gives native machine file system entry. The second MCP consumer is connecting to a remotely hosted MCP server that’s offering entry to a distant file system.

MCP shoppers trade messages with MCP servers utilizing JSON-RPC 2.0 (because the wire format). For native information sources, MCP makes use of JSON-RPC over stdio (Customary Enter/Output) because the transport. Determine 3., illustrates how an MCP-C connects to a neighborhood MCP-S for file or DB entry utilizing stdio. The MCP-S sends JSON-RPC messages to its commonplace output / stdout and reads from the usual enter / stdin.

Determine 3. JSON-RPC over stdio

Right here is an instance of operating an MCP filesystem server domestically in stdio mode and proscribing entry to a really particular listing:

npx -y @modelcontextprotocol/server-filesystem /Customers/shmcfarl/code/mcp-testing
Safe MCP Filesystem Server operating on stdio
Allowed directories: [ '/Users/shmcfarl/code/mcp-testing' ]

Utilizing a terrific take a look at device such because the MCP Inspector you may pair a neighborhood consumer (MCP Inspector) along with your domestically operating stdio or HTTP+SSE server:

npx -y @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem /Customers/shmcfarl/code/mcp-testing
Beginning MCP inspector...
Proxy server listening on port 3000

MCP Inspector is up and operating at http://localhost:5173
Question parameters: {
  transportType: 'stdio',
  command: 'npx',
  args: '-y @modelcontextprotocol/server-filesystem -y /Customers/shmcfarl/code/mcp-testing',
. . . [Output removed for clarity]
Spawned stdio transport
Linked MCP consumer to backing server transport
Created net app transport
Created net app transport
Arrange MCP proxy
Acquired message for sessionId 697bd02d-5d67-4dfc-85b9-6a12d6a99f45
Acquired message for sessionId 697bd02d-5d67-4dfc-85b9-6a12d6a99f45
Acquired message for sessionId 697bd02d-5d67-4dfc-85b9-6a12d6a99f45
Acquired message for sessionId 697bd02d-5d67-4dfc-85b9-6a12d6a99f45

MCP helps HTTP+SSE (Server-Despatched Occasions) to ship structured requests from service backends utilizing MCP servers to MCP shoppers for native or distant connections. The 2025-03-26 specification modifications states that MCP is transferring to a extra versatile Streamable HTTP transport. Nevertheless, HTTP+SSE transport can nonetheless be used for backward compatibility. This retains it clear, traceable, and tool-agnostic. Be aware: As of the time of scripting this weblog, the brand new Streaming HTTP assist just isn’t accomplished in every SDK.

Determine 4 illustrates the connection movement for HTTP+SSE eventualities. Within the determine, HTTP POST is used for MCP-C -to- MCP-S messages. HTTP+SSE is used for MCP-S -to- MCP-C messages.

Determine 4. MCP-C -to- MCP-S communication utilizing HTTP+SSE

You possibly can undergo the MCP quickstart server and consumer guides to learn to setup your personal climate consumer/server combo: https://modelcontextprotocol.io/quickstart/server. Utilizing an identical setup, you may see some HTTP messages for stuff like a instruments checklist name:

POST /messages/?session_id=6ccde3779adf43cc9d3f5f661508310b HTTP/1.1
Host: 0.0.0.0:8080
Settle for: */*
Settle for-Encoding: gzip, deflate
Connection: keep-alive
Person-Agent: python-httpx/0.28.1
Content material-Size: 46
Content material-Sort: utility/json

{"methodology":"instruments/checklist","jsonrpc":"2.0","id":2}
HTTP/1.1 202 Accepted
date: Tue, 08 Apr 2025 20:14:51 GMT
server: uvicorn
content-length: 8

Accepted

And a device name to get the climate forecast:

POST /messages/?session_id=6ccde3779adf43cc9d3f5f661508310b HTTP/1.1
Host: 0.0.0.0:8080
Settle for: */*
Settle for-Encoding: gzip, deflate
Connection: keep-alive
Person-Agent: python-httpx/0.28.1
Content material-Size: 134
Content material-Sort: utility/json

{"methodology":"instruments/name","params":{"title":"get_forecast","arguments":{"latitude":39.7392,"longitude":-104.9903}},"jsonrpc":"2.0","id":3}
HTTP/1.1 202 Accepted
date: Tue, 08 Apr 2025 20:14:54 GMT
server: uvicorn
content-length: 8

Accepted

And a response for the climate forecast immediate I entered for Denver, CO:

occasion: message
information: {"jsonrpc":"2.0","id":3,"outcome":{"content material":[{"type":"text","text":"nThis Afternoon:nTemperature: 74..FnWind: 12 mph WnForecast: Partly sunny. High near 74, with temperatures falling to around 72 in the afternoon. West wind around 12 mph, with gusts as high as 18 mph.nn---nnTonight:nTemperature: 42..FnWind: 5 to 10 mph WSWnForecast: Partly cloudy, with a low around 42. West southwest wind 5 to 10 mph, with gusts as high as 18 mph.nn---nnWednesday:nTemperature: 71..FnWind: 5 to 15 mph WnForecast: Mostly sunny, with a high near 71. West wind 5 to 15 mph, with gusts as high as 24 mph.nn---nnWednesday Night:nTemperature: 40..FnWind: 2 to 14 mph WNWnForecast: Mostly clear, with a low around 40. West northwest wind 2 to 14 mph, with gusts as high as 29 mph.nn---nnThursday:nTemperature: 68..FnWind: 2 to 8 mph ESEnForecast: Sunny, with a high near 68. East southeast wind 2 to 8 mph, with gusts as high as 16 mph.n"}],"isError":false}}

Because the specification change to Streamable HTTP could be very latest and never absolutely carried out as of the writing of this weblog, I’ll forgo doing a granular clarification of that connection sequence. I really helpful that you simply learn in regards to the proposed Streamable HTTP implementation right here: https://modelcontextprotocol.io/specification/2025-03-26/primary/transports#streamable-http.

Discovery

When an agent must work together with a device or service, MCP offers a useful resource discovery mechanism that lets MCP shoppers uncover obtainable assets. The MCP consumer can use direct assets or useful resource templates. You possibly can learn extra in regards to the useful resource discovery choices at https://modelcontextprotocol.io/docs/ideas/assets. However, the necessary factor to know is that the aim of useful resource discovery is to search out out the next info:

  • Supported capabilities and actions
  • Protocol variations
  • Customized metadata

Determine 5 exhibits the MCP-C to MCP-S request/response movement for the capabilities discovery.

Determine 5. MCP Discovery Stream

Whereas there isn’t any MCP server registry that MCP shoppers can search to dynamically uncover all obtainable MCP servers and their capabilities, there are MCP server directories as was famous early within the doc. There’s an ever-growing variety of MCP directories and in lots of circumstances, all of them have the identical or comparable checklist of MCP servers. A couple of of the numerous websites embody:

MCP Useful resource Discovery – Instance

Let’s have a look at an instance of useful resource discovery utilizing direct assets.

I’ve the SQLite MCP Server operating on my native machine. I’m utilizing Claude Desktop as my AI utility with the MCP consumer performance configured to make use of the SQLite MCP server. Here’s a snippet from my claude_desktop_config.json file:

"mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "/Users/shmcfarl/code/mcp-testing/sqlite/test.db"]
    },

After I use Claude Desktop to device name SQLite and ask for an inventory of server assets, you may see the message trade from the MCP consumer to MCP server.

2025-04-09T18:08:37.964Z [sqlite] [info] Message from consumer: {"methodology":"assets/checklist","params":{},"jsonrpc":"2.0","id":44}
2025-04-09T18:08:37.965Z [sqlite] [info] Message from server: {"jsonrpc":"2.0","id":44,"outcome":{"assets":[{"uri":"memo://insights","name":"Business Insights Memo","description":"A living document of discovered business insights","mimeType":"text/plain"}]}}

Per the MCP specification you may see the strategy utilized by the MCP consumer is assets/checklist and the MCP server responds utilizing the direct assets format:

{
  uri: string;           // Distinctive identifier for the useful resource
  title: string;          // Human-readable title
  description?: string;  // Non-compulsory description
  mimeType?: string;     // Non-compulsory MIME sort
}

Conclusion

MCP is off to a robust begin, particularly for DevOps groups experimenting with AI-driven automation.

On the identical time, it’s nonetheless a younger protocol. MCP provides you a clear basis should you’re constructing AI-enabled workflows that have to work together with infrastructure and instruments safely—however you’ll nonetheless have to assess match on your particular use case.

There’s much more introductory content material that I may cowl, however I feel this lays a basis for the remainder of the weblog collection. For the rest of the blogs it is vital so that you can know:

MCP is good for:

  • Brokers want to connect with a number of information sources and providers in an ordinary means
  • It abstracts away the per-integration code complexity – simply use the MCP SDK
  • You want it for a low toil platform or with IDE integrations

What doesn’t MCP do (not less than in the present day)?

  • MCP just isn’t an agent-to-agent framework
  • MCP just isn’t used for the creation, deployment, lifecycle administration, and safety of brokers or instruments
  • MCP just isn’t an LLM
  • MCP just isn’t an information supply
  • MCP doesn’t dynamically uncover instruments and providers the MCP server will symbolize

We additionally discovered how MCP shoppers and servers work together with each other and over which varieties of protocol and messaging codecs.

Let’s cease there and choose again up within the subsequent weblog on MCP for DevOps: Use Instances

Desire to see it in motion? Watch the complete MCP for DevOps: Structure & Parts video walkthrough right here: https://youtu.be/Qdms0EHwhOw

Subsequent within the collection

MCP for DevOps: Use Instances

✅ AI Brokers Triggering DevOps Instruments Use MCP to work together with current DevOps scripts, APIs, or providers in an ordinary format an AI agent can devour.

✅ Infrastructure-Conscious LLMs Let your AI apps ask structured questions like “What kubernetes providers are operating in namespace default?” or “Create a brand new database desk”—with dwell solutions from programs through MCP servers.

✅ Safe Software Invocation through AI expose choose CLI instruments or automation workflows by an MCP server interface, permitting AI brokers to work together with them below managed circumstances comparable to utilizing a Docker scout MCP to scan pictures.

See you on the subsequent publish!

Share:

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles