<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Casper's journey]]></title><description><![CDATA[Casper's journey]]></description><link>https://casperwmn.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 21 Nov 2026 16:16:51 GMT</lastBuildDate><atom:link href="https://casperwmn.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Give Your Agent Dapr's Building Blocks Through the Dapr MCP Server]]></title><description><![CDATA[The Dapr MCP server turns a Dapr sidecar's building blocks into Model Context Protocol tools. It's alpha, so tool names and configuration can still change…]]></description><link>https://casperwmn.hashnode.dev/give-your-agent-dapr-s-building-blocks-through-the-dapr-mcp-server</link><guid isPermaLink="true">https://casperwmn.hashnode.dev/give-your-agent-dapr-s-building-blocks-through-the-dapr-mcp-server</guid><category><![CDATA[mcp]]></category><category><![CDATA[dapr]]></category><category><![CDATA[ai agents]]></category><dc:creator><![CDATA[Casper Nielsen]]></dc:creator><pubDate>Fri, 13 Nov 2026 09:26:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ac5545dd3c31f529932d8c0/fd79a634-8381-4eb5-98c5-3b261e16584f.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Dapr MCP server turns a Dapr sidecar's building blocks into Model Context Protocol tools. It's alpha, so tool names and configuration can still change. What you get today is one MCP endpoint that lets any client – Claude Code, Cursor, VS Code, or an agent you wrote – save state, publish events, read secrets or take a distributed lock through the same sidecar your services use.</p>
<p>The server reads the sidecar's metadata and registers tools only for building blocks that have a component loaded. If there's no pub/sub component, there are no pub/sub tools. Three are always there: <code>get_components</code>, <code>invoke_service</code> and <code>invoke_actor_method</code>.</p>
<h2>Set it up</h2>
<p>Two in-memory components, in <code>./components</code>:</p>
<pre><code class="language-yaml"># components/statestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: statestore
spec:
  type: state.in-memory
  version: v1
---
# components/pubsub.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: pubsub
spec:
  type: pubsub.in-memory
  version: v1
</code></pre>
<p>Install the server (or grab a binary from the repo's releases page) and run it next to a sidecar, over streamable HTTP on localhost:</p>
<pre><code class="language-bash">go install github.com/dapr/dapr-mcp-server/cmd/dapr-mcp-server@latest
dapr init
dapr run --app-id dapr-mcp-server --resources-path ./components -- dapr-mcp-server --http localhost:8080
curl http://localhost:8080/readyz
</code></pre>
<h2>Point Claude Code at it</h2>
<pre><code class="language-bash">claude mcp add --transport http dapr http://localhost:8080/
</code></pre>
<p>Call <code>get_components</code> first. It tells the client which state stores and brokers exist, and the other tools need those names.</p>
<h2>Give a Python agent the same MCP tools</h2>
<pre><code class="language-python">import asyncio
from dapr_agents import Agent
from dapr_agents.tool.mcp import MCPClient

async def main():
    client = MCPClient(
        allowed_tools={"get_components", "get_state", "save_state", "publish_event"}
    )
    await client.connect_streamable_http(server_name="dapr", url="http://localhost:8080/")

    agent = Agent(
        name="checklist-keeper",
        role="Keeps a release checklist and announces changes",
        instructions=[
            "Call get_components first to find the state store and pub/sub names.",
            "Keep the checklist under the key 'release-checklist'.",
            "After every change, publish the new checklist to the topic 'checklist'.",
        ],
        tools=client.get_all_tools(),
    )

    print(await agent.run("Add 'update the quickstart README' to the checklist."))
    await client.close()

asyncio.run(main())
</code></pre>
<p>You'll need an API key for whichever LLM provider you've configured. <code>allowed_tools</code> keeps <code>delete_state</code>, <code>execute_transaction</code> and the rest out of the agent's reach. The docs say to treat destructive tools like those as needing human confirmation, and I'd start every agent on the smallest list that does the job.</p>
<p>Before it goes anywhere near a network Authentication is off until you set <code>AUTH_MODE</code> (oidc, spiffe, dapr-sentry or hybrid). Without it, anyone who can reach the HTTP port can call every tool, so keep it on localhost until auth is on. Every loaded component turns into tools, so use component scopes to load only what the agent needs. Each tool also carries MCP safety annotations, which clients can use to tell reads from writes.</p>
<p>The Dapr MCP server section of the highlights post is here: <a href="https://www.diagrid.io/blog/dapr-1-19-release-highlights">https://www.diagrid.io/blog/dapr-1-19-release-highlights</a>. It's alpha, so I want to hear what breaks. Point it at your own components and lmk which tool you reached for first 👀</p>
]]></content:encoded></item></channel></rss>