Skip to main content

Agentity MCP protocol plugin for Anthropic

Project description

agentity-mcp

MCP (Model Context Protocol) plugin for Agentity. Wrap any MCP server to inject Agentity identity into tool calls — enabling scoped, verifiable agent-to-tool requests.

Installation

pip install agentity-mcp

Usage

from agentity_mcp import McpServerWrapper

# Wrap an MCP server with Agentity identity
wrapper = McpServerWrapper()

print(f"Agent DID: {wrapper.agent_did}")
print(f"Scopes: {wrapper.agent_scope}")

# Get signed headers for any MCP request
headers = wrapper.get_headers(method="POST", path="/tools/call", body=b'{}')
# {
#   "Agentity-Token": "<base64(AID)>.<base64(sig)>",
#   "Agentity-Nonce": "<uuid-v4>",
#   "Agentity-Timestamp": "<ISO-8601>",
# }

Custom keypair and identity

from agentity_sdk import AgentKeyPair
from agentity_mcp import McpServerWrapper

kp = AgentKeyPair()
aid = kp.create_identity(
    owner_did="did:agentity:human:alice",
    scopes=["mcp:tool:call", "mcp:resource:read"],
    ttl_days=30,
)

wrapper = McpServerWrapper(keypair=kp, identity=aid)

Default scopes

When no identity is provided, McpServerWrapper auto-creates one with scopes:

  • mcp:tool:call
  • mcp:resource:read

API

Method / Property Description
McpServerWrapper(keypair?, identity?) Create wrapper, auto-generates identity if omitted
.get_headers(method, path, body?) Get signed Agentity headers for an MCP request
.agent_did The agent's DID string
.agent_scope The agent's scope list

License: Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentity_mcp-0.1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentity_mcp-0.1.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file agentity_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: agentity_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentity_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 20f783592ac42cf0b576fee4706ee1e1396f4ff3d8c421589684a4a946778484
MD5 ae8bc466edd4fd390e52dab509307189
BLAKE2b-256 5acf4e2f596f3a76ba54828e106fef915e3f4e4edcd8d255c28bbbc9c0474cb4

See more details on using hashes here.

File details

Details for the file agentity_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agentity_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentity_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eae5d3f463fc6e025b6cd1c090f8d5fabe0ca0a4387d48b5a191d5e649b97896
MD5 c9a947986169ad3132812d8602295960
BLAKE2b-256 d8aa690049ed6637e1a0d94b7140db12d9fb5e0db8f816ed60fae32d331fd30f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page