<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Json-Rpc on Ou David | Systems Engineer</title><link>https://preview.vvivid.dev/tags/json-rpc/</link><description>Recent content in Json-Rpc on Ou David | Systems Engineer</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 30 Aug 2025 10:00:00 +0000</lastBuildDate><atom:link href="https://preview.vvivid.dev/tags/json-rpc/index.xml" rel="self" type="application/rss+xml"/><item><title>Building a JSON-RPC Server in Go: Complete Implementation Guide</title><link>https://preview.vvivid.dev/posts/jsonrpc_example/</link><pubDate>Sat, 30 Aug 2025 10:00:00 +0000</pubDate><guid>https://preview.vvivid.dev/posts/jsonrpc_example/</guid><description>&lt;p&gt;Last week, I posted about &lt;a href="https://preview.vvivid.dev/posts/json_rpc_the_protocol_behind_mcp/"&gt;JSON-RPC and the Model Context Protocol&lt;/a&gt;. Today, we&amp;rsquo;re going to see an example of how we can create a simple application following the JSON-RPC standard. We&amp;rsquo;ll build a simple JSON-RPC calculator together, and I hope you&amp;rsquo;ll enjoy it.&lt;/p&gt;
&lt;h2 id="request-flow-overview"&gt;Request Flow Overview&lt;/h2&gt;
&lt;div class="mermaid"&gt;
flowchart LR
A[Client Request] --&gt; B[Parse JSON]
B --&gt; C{Valid?}
C --&gt;|No| D[Error Response]
C --&gt;|Yes| E{Type?}
E --&gt;|Request| F[Match Method]
E --&gt;|Notification| G[Execute &amp; End]
F --&gt; H{Method Found?}
H --&gt;|No| I[Method Not Found]
H --&gt;|Yes| J[Execute Method]
J --&gt; K[Build Response]
I --&gt; K
K --&gt; L[Send Response]
D --&gt; L
L --&gt; M[End]
G --&gt; M
&lt;/div&gt;&lt;h2 id="message-parsing-and-validation"&gt;Message Parsing and Validation&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s recap JSON-RPC message types. We have 3 types of messages: Request, Response, and Notification. For request and response types, we can send them in batches, and responses must be returned in a batch matching the request IDs in any order. We can distinguish between a request and a notification by checking the ID field. If there&amp;rsquo;s an ID, it&amp;rsquo;s a request; if not, it&amp;rsquo;s a notification.&lt;/p&gt;</description></item><item><title>Understanding JSON-RPC: The Protocol Behind MCP</title><link>https://preview.vvivid.dev/posts/json_rpc_the_protocol_behind_mcp/</link><pubDate>Sun, 24 Aug 2025 00:00:00 +0000</pubDate><guid>https://preview.vvivid.dev/posts/json_rpc_the_protocol_behind_mcp/</guid><description>&lt;p&gt;I&amp;rsquo;ve been diving into the &lt;a href="https://modelcontextprotocol.io/"&gt;Model Context Protocol (MCP)&lt;/a&gt; lately. Honestly, it&amp;rsquo;s the most exciting thing happening in AI infrastructure right now. But here&amp;rsquo;s the thing: to really understand MCP, you need to understand &lt;a href="https://www.jsonrpc.org/specification"&gt;JSON-RPC&lt;/a&gt; first. That&amp;rsquo;s what MCP is built on.&lt;/p&gt;
&lt;p&gt;So let me break down JSON-RPC for you. Once you get this, MCP will make way more sense.&lt;/p&gt;
&lt;p&gt;First, let&amp;rsquo;s talk about how JSON-RPC is different from the REST APIs we&amp;rsquo;re all used to. REST is stateless and unidirectional where each request is independent. Check this out:&lt;/p&gt;</description></item></channel></rss>