Sandbox
@ithena-one/mcp-governance-sdk

Governance SDK for MCP servers

This SDK adds governance features to MCP servers: identity resolution, RBAC, credential injection, audit logging, structured logging, and trace context propagation. It sits around the base MCP server and runs requests through a governance pipeline before your handlers execute.

39 starsโ€ข7 forksโ€ขTypeScriptโ€ขUpdated 1y ago
Who it's for

Builders who run MCP servers and want identity, RBAC, secrets, and audit logs in one layer.

What it delivers

You can ship MCP servers with access control and observability built in instead of adding each piece by hand.

What it does

Pluggable identity resolution

Resolves the caller identity through an `IdentityResolver` interface.

Role-based access control

Checks permissions with `RoleStore` and `PermissionStore`.

Secure credential injection

Supplies handler secrets through a `CredentialResolver`.

Audit logging

Records governed requests in an `AuditLogStore` for compliance and review.

Structured logging

Adds request-scoped logs through a `Logger` interface.

Trace propagation

Carries W3C trace context with `TraceContextProvider`.

Governance pipeline

Wraps the base MCP `Server` and processes requests through a configurable pipeline.

Defaults for development

Includes built-in default implementations for local development and testing.

How to get it

  1. 1Run
    npm install @ithena-one/mcp-governance @modelcontextprotocol/sdk zod
    # or
    yarn add @ithena-one/mcp-governance @modelcontextprotocol/sdk zod
    # or
    pnpm add @ithena-one/mcp-governance @modelcontextprotocol/sdk zod

README

Ithena Logo

MCP Governance SDK (@ithena-one/mcp-governance)

NPM Version NPM Downloads License: Apache-2.0 X Follow

Ithena - AuthN, AuthZ, RBAC, Auditing, & Compliance Framework for MCP | Product Hunt

Website: ithena.one

The missing governance layer for your Model Context Protocol (MCP) servers.

Build secure, compliant, and observable MCP applications with Ithena. Easily add Identity, Authorization (RBAC), Credential Management, Auditing, Logging, and Tracing using our SDK for servers built with @modelcontextprotocol/typescript-sdk, or leverage the upcoming Ithena Managed Platform (waitlist open!).


๐Ÿ“š Documentation:


The Problem: Production MCP Needs More

The standard @modelcontextprotocol/sdk is excellent for implementing the core MCP communication protocol. However, deploying MCP servers in production, especially in enterprise environments, requires addressing critical governance questions:

  • โ“ Who is accessing data and tools? (Authentication)
  • ๐Ÿ”’ Are they allowed to do that? (Authorization)
  • ๐Ÿ”‘ How do handlers securely access needed secrets? (Credentials)
  • ๐Ÿ“ What happened? (Auditing & Compliance)
  • ๐Ÿฉบ How do we monitor and debug effectively? (Logging & Tracing)

Implementing these consistently across every MCP server is complex and error-prone.

The Solution: @ithena-one/mcp-governance

This SDK provides a standard, pluggable framework that wraps the base Server class, letting you integrate essential governance features without rewriting your core MCP logic.

Ithena offers two ways to achieve this: the open-source SDK (@ithena-one/mcp-governance) for self-hosting, and the upcoming Ithena Managed Platform (currently accepting users via a waitlist) which provides hosted, production-ready backends for the SDK's interfaces, eliminating infrastructure management.

Benefits:

  • โœ… Standardize Governance: Consistent handling of identity, permissions, secrets, and auditing.
  • ๐Ÿ”’ Enhance Security: Enforce access controls and securely manage credentials.
  • ๐Ÿ“ Meet Compliance: Generate detailed audit trails for regulatory requirements.
  • ๐Ÿงฉ Pluggable Architecture: Integrate easily with your existing enterprise systems (IDPs, Secret Managers, SIEMs) via well-defined interfaces. (See Interfaces)
  • โš™๏ธ Focus on Business Logic: Let the SDK handle governance boilerplate, allowing your team to focus on building valuable MCP resources, tools, and prompts.
  • ๐Ÿš€ Faster Development: Get production-ready features out-of-the-box with sensible defaults for development and testing. (See Defaults)
  • โ˜๏ธ Optional Managed Platform: Skip infrastructure setup and management by using the Ithena Managed Platform (join the waitlist!).

Key Features

  • ๐Ÿ†” Pluggable Identity Resolution (IdentityResolver)
  • ๐Ÿ›ก๏ธ Flexible Role-Based Access Control (RoleStore, PermissionStore)
  • ๐Ÿ”‘ Secure Credential Injection (CredentialResolver)
  • โœ๏ธ Comprehensive Auditing (AuditLogStore)
  • ๐Ÿชต Structured, Request-Scoped Logging (Logger)
  • ๐Ÿ”— Trace Context Propagation (W3C default via TraceContextProvider)
  • โš™๏ธ Configurable Governance Pipeline (See Core Concepts)
  • ๐Ÿ“ฆ Minimal Intrusion (Wraps the base SDK Server)

Architecture Overview

@ithena-one/mcp-governance intercepts incoming MCP requests and notifications, processing them through a defined pipeline before (or during) the execution of your business logic handlers.

graph LR
    A[MCP Request In] --> B(Context Setup: EventID, Logger, TraceContext);
    B --> C{IdentityResolver?};
    C -- Yes --> D[Resolve Identity];
    C -- No --> E[Identity = null];
    D --> E;
    E --> F{RBAC Enabled?};
    F -- No --> K[Credential Resolution];
    F -- Yes --> G{Identity Resolved?};
    G -- No --> H(DENY: Identity Required);
    G -- Yes --> I[Derive Permission];
    I --> J{Permission Check Needed?};
    J -- No (null permission) --> L{Post-Auth Hook?};
    J -- Yes --> J1[Get Roles];
    J1 --> J2[Check Permissions];
    J2 -- Denied --> H2(DENY: Insufficient Permission);
    J2 -- Granted --> L;
    L -- Yes --> M[Execute Hook];
    L -- No --> K;
    M --> K;
    K -- Yes (Resolver Exists) --> N[Resolve Credentials];
    K -- No --> O[Credentials = null/undefined];
    N -- Error & failOnError=true --> P(FAIL: Credentials Error);
    N -- Error & failOnError=false --> O;
    N -- Success --> O;
    O --> Q[Execute Governed Handler];
    Q -- Success --> R[Result];
    Q -- Error --> S(FAIL: Handler Error);
    R --> T(Send Response);
    S --> T;
    P --> T;
    H --> T;
    H2 --> T;
    T --> U(Audit Log);

    style H fill:#f99,stroke:#333,stroke-width:2px;
    style H2 fill:#f99,stroke:#333,stroke-width:2px;
    style P fill:#f99,stroke:#333,stroke-width:2px;
    style S fill:#f99,stroke:#333,stroke-width:2px;
    style U fill:#ccf,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;

See Core Concepts for more details on the pipeline.

The SDK defines interfaces (like IdentityResolver, AuditLogStore, etc.). You can implement these yourself or use clients connecting to the Ithena Managed Platform (waitlist open) for a hosted solution.

SDK vs. Managed Platform

Ithena offers flexibility in how you implement MCP governance:

  1. @ithena-one/mcp-governance SDK (Open Source):

    • Provides the core GovernedServer, pipeline, and governance interfaces (IdentityResolver, RoleStore, AuditLogStore, etc.).
    • You implement the backend logic for these interfaces, integrating with your existing systems (databases, secret managers, SIEMs).
    • Use Case: Full control over infrastructure, integrating deeply with bespoke internal systems. Requires infrastructure management.
  2. Ithena Managed Platform (Waitlist Open):

    • A hosted cloud service providing production-ready, scalable backend implementations for the SDK's interfaces via simple API clients.
    • Use the same SDK, but configure it to point to the Ithena Platform APIs instead of your own backends.
    • Use Case: Faster time-to-market, reduced operational burden, focus purely on MCP application logic.
    • โžก๏ธ Join the Waitlist

You choose the approach that best fits your needs. The SDK seamlessly supports both self-hosted and platform-based backends.

Installation

npm install @ithena-one/mcp-governance @modelcontextprotocol/sdk zod
# or
yarn add @ithena-one/mcp-governance @modelcontextprotocol/sdk zod
# or
pnpm add @ithena-one/mcp-governance @modelcontextprotocol/sdk zod

Peer Dependencies: Make sure you have compatible versions of @modelcontextprotocol/sdk (check peerDependencies in package.json) and zod installed.

Quick Start

See the Getting Started Guide for a runnable example.

Next Steps

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

Files in the repo

Repository payloadโ€ข14 top-level entries
  • docs
  • public
  • src
  • .eslintrc.cjs
  • .gitignore
  • jest.config.js
  • LICENSE
  • package-lock.json
  • package.json
  • readme.md
  • tsconfig.cjs.json
  • tsconfig.esm.json
  • tsconfig.json
  • tsconfig.types.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents โ€” swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

๐Ÿ•ท๏ธ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k