Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.81 KB

File metadata and controls

92 lines (63 loc) · 2.81 KB

SPDK Python Bindings and Scripts

PyPI Latest Release PyPI Downloads

Overview

The Storage Performance Development Kit (SPDK) provides a set of tools and libraries for writing high performance, scalable, user-mode storage applications. This directory contains Python bindings and scripts that facilitate interaction with SPDK components.

Installation

Examples below are using UV.

An extremely fast Python package and project manager, written in Rust.

$ uv venv
$ source .venv/bin/activate

Then, you can install spdk from PyPI with:

uv pip install spdk

or install from source with:

git clone https://github.com/spdk/spdk.git
cd spdk
uv pip install python/

Getting Started

From a shell:

spdk-rpc rpc_get_methods

From a Python interpreter:

>>> from spdk.rpc.client import JSONRPCClient

>>> client = JSONRPCClient(server_addr, port)
>>> client.rpc_get_methods()

For more information, see https://spdk.io/doc/jsonrpc.html

Model Context Protocol (MCP)

Install in VS Code

The Model Context Protocol (MCP) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions.

MCP servers can:

  • Expose data through Resources (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
  • Provide functionality through Tools (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
  • Define interaction patterns through Prompts (reusable templates for LLM interactions)
  • And more!

The SPDK MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with SPDK APIs, enabling advanced automation and interaction capabilities for developers and tools.

$ uv venv
$ source .venv/bin/activate
$ uv pip install spdk[mcp]
or locally
$ uv pip install python/[mcp]

You can install this server in Claude Desktop and interact with it right away by running:

mcp install server.py

Alternatively, you can test it with the MCP Inspector:

mcp dev server.py