gRPC Zig

Security

Blazigly fast gRPC/MCP client & server implementation in zig.

Your AI app calls the gRPC Zig MCP server, which does the security work and sends the result back to the chat.

About gRPC Zig

gRPC Zig is a community MCP server from ziglana, filed in our directory under security. Blazigly fast gRPC/MCP client & server implementation in zig.

At a glance

Publisher
ziglana (community)
Runs
See the README for setup
Written in
Zig
License
Unlicense
GitHub stars
147

How to set up gRPC Zig

  1. Follow the install steps in the gRPC Zig README; it is written in Zig, so have that toolchain ready.
  2. Check the gRPC Zig README for keys or settings; the registry lists none that gRPC Zig requires.
  3. Add gRPC Zig to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the gRPC Zig tools to confirm the connection.
  5. Run one read-only task with gRPC Zig first, and keep your app asking before each tool call until the results look right.

gRPC Zig compared with similar servers

  • Pentest by DMontgomery40 has more GitHub stars than gRPC Zig (149 against 147); both are community servers, and both run locally.
  • NPMScan by salemalem has more GitHub stars than gRPC Zig (151 against 147); both are community servers, and NPMScan runs as a remote server and gRPC Zig runs on your own machine.
  • Gori by hahwul has more GitHub stars than gRPC Zig (151 against 147); both are community servers, and both run locally.

Before you connect gRPC Zig

  • Give gRPC Zig its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each gRPC Zig tool call until you trust what it does with them.
  • Treat text that gRPC Zig fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for gRPC Zig on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for gRPC Zig

How marketing and sales teams put gRPC Zig to work, by company size. Pick the size closest to yours and start gRPC Zig on one use case.

Small business

  • A small business can use gRPC Zig to check its domains, logins and site for common gaps before they cost a customer's trust.
  • Owners can ask gRPC Zig whether a tool or vendor has known issues before connecting it to customer data.
  • gRPC Zig runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing ops can use gRPC Zig to review what each connected app can access and remove keys nobody uses.
  • Security and web teams can connect gRPC Zig to scan campaign sites and forms before launch, not after an incident.
  • Start gRPC Zig on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can run gRPC Zig in the security team's tooling, so marketing's agents and apps are reviewed like any other system.
  • Large orgs can use gRPC Zig to keep evidence for audits, showing which agents reached which data and when.
  • gRPC Zig is a community server, so have security review the code and pin a version before gRPC Zig touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

gRPC Zig README

From ziglana/gRPC-zig on GitHub, shared under its Unlicense license. Images are left out; the original has them.

README.md

🚀 gRPC-zig

A blazingly fast gRPC client & server implementation in Zig, designed for maximum performance and minimal overhead.

⚡️ Features

  • 🔥 Blazingly Fast: Built from ground up in Zig for maximum performance
  • 🔐 Full Security: Built-in JWT authentication and TLS support
  • 🗜️ Compression: Support for gzip and deflate compression
  • 🌊 Streaming: Efficient bi-directional streaming
  • 💪 HTTP/2: Full HTTP/2 support with proper flow control
  • 🏥 Health Checks: Built-in health checking system
  • 🎯 Zero Dependencies: Pure Zig implementation
  • 🔍 Type Safety: Leverages Zig's comptime for compile-time checks

🚀 Quick Start

const std = @import("std");
const GrpcServer = @import("grpc-server").GrpcServer;

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    // Create and configure server
    var server = try GrpcServer.init(allocator, 50051, "secret-key");
    defer server.deinit();

    // Register handlers
    try server.handlers.append(allocator, .{
        .name = "SayHello",
        .handler_fn = sayHello,
    });

    // Start server
    try server.start();
}

fn sayHello(request: []const u8, allocator: std.mem.Allocator) ![]u8 {
    _ = request;
    return allocator.dupe(u8, "Hello from gRPC-zig!");
}

📚 Examples

Basic Server

See examples/basic_server.zig for a complete example.

const std = @import("std");
const GrpcServer = @import("grpc-server").GrpcServer;

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    var server = try GrpcServer.init(allocator, 50051, "secret-key");
    defer server.deinit();

    try server.start();
}
Basic Client

See examples/basic_client.zig for a complete example.

const std = @import("std");
const GrpcClient = @import("grpc-client").GrpcClient;

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    var client = try GrpcClient.init(allocator, "localhost", 50051);
    defer client.deinit();

    const response = try client.call("SayHello", "World", .none);
    defer allocator.free(response);

    std.debug.print("Response: {s}\n", .{response});
}
Features

All features are demonstrated in the examples/ directory:

🔧 Installation

Option 1: Using zig fetch (Recommended)
  1. Add the dependency to your project:
zig fetch --save git+https://github.com/ziglana/gRPC-zig#main
  1. Add to your build.zig:
const grpc_zig_dep = b.dependency("grpc_zig", .{
    .target = target,
    .optimize = optimize,
});

// For server development
exe.root_module.addImport("grpc-server", grpc_zig_dep.module("grpc-server"));

// For client development
exe.root_module.addImport("grpc-client", grpc_zig_dep.module("grpc-client"));
  1. Import in your code:
const GrpcServer = @import("grpc-server").GrpcServer;
const GrpcClient = @import("grpc-client").GrpcClient;
Option 2: Manual setup

Clone the repository and add it to your build.zig.zon:

.{
    .name = "my-project",
    .version = "0.1.0",
    .dependencies = .{
        .grpc_zig = .{
            .url = "https://github.com/ziglana/gRPC-zig/archive/refs/heads/main.tar.gz",
            // Replace with actual hash after first fetch
            .hash = "...",
        },
    },
}

🏃 Performance

Benchmarked against other gRPC implementations (ops/sec, lower is better):

gRPC-zig    │████████░░░░░░░░░░│  2.1ms
gRPC Go     │██████████████░░░░│  3.8ms
gRPC C++    │████████████████░░│  4.2ms
Running Benchmarks

The repository includes a built-in benchmarking tool to measure performance:

# Build the benchmark tool
zig build

# Run benchmarks with default settings
zig build benchmark

# Run with custom parameters
./zig-out/bin/grpc-benchmark --help
./zig-out/bin/grpc-benchmark --requests 1000 --clients 10 --output json

# Or use the convenient script
./scripts/run_benchmark.sh

Benchmark Options:

  • --host <host>: Server host (default: localhost)
  • --port <port>: Server port (default: 50051)
  • --requests <n>: Number of requests per client (default: 1000)
  • --clients <n>: Number of concurrent clients (default: 10)
  • --size <bytes>: Request payload size (default: 1024)
  • --output <format>: Output format: text|json (default: text)

Benchmark Metrics:

  • Latency statistics (min, max, average, P95, P99)
  • Throughput (requests per second)
  • Error rates and success rates
  • Total execution time

The benchmarks automatically run in CI/CD on every pull request and provide performance feedback.

📖 Detailed Benchmarking Guide

🧪 Testing

Unit Tests

Run the unit test suite:

zig build test

The test suite covers:

  • Compression algorithms (gzip, deflate, none)
  • Benchmark handler functionality
  • Core protocol functionality
Integration Tests

Run integration tests with a Python client validating the Zig server:

cd integration_test
./run_tests.sh

Or manually:

# Build and start the test server
zig build integration_test
./zig-out/bin/grpc-test-server

# In another terminal, run Python tests
cd integration_test
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 test_client.py

The integration tests validate:

  • HTTP/2 protocol compliance
  • gRPC request/response flow
  • Compression functionality
  • Health checking
  • Authentication integration

📖 Integration Test Documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📜 License

This project is licensed under the Unlicense - see the LICENSE file for details.

⭐️ Support

If you find this project useful, please consider giving it a star on GitHub to show your support!

🙏 Acknowledgments

  • Spice - For the amazing Protocol Buffers implementation
  • Tonic - For inspiration on API design
  • The Zig community for their invaluable feedback and support

Made with ❤️ in Zig

Questions about gRPC Zig

What is the gRPC Zig MCP server?

Blazigly fast gRPC/MCP client & server implementation in zig. gRPC Zig is maintained by ziglana on GitHub at ziglana/gRPC-zig, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the gRPC Zig MCP server?

gRPC Zig doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (ziglana/gRPC-zig). Like most servers, gRPC Zig ends with a command or URL you paste into your AI app's MCP config.

Does gRPC Zig need an API key?

The registry lists no required keys for gRPC Zig. Check the gRPC Zig README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is gRPC Zig an official MCP server?

No. gRPC Zig is a community server maintained by ziglana. Community servers can be excellent; read the code and the open issues before you give gRPC Zig access to company data.

What license is gRPC Zig under?

gRPC Zig is released under the Unlicense license, according to its GitHub repository. The license covers the code of gRPC Zig; the service it connects to has its own terms.