Use AgentCred's MCP server as tools in CrewAI agents. Your crew members get cryptographic signing capabilities via the Model Context Protocol.
- Node.js 18+ (for the AgentCred MCP server)
- Python 3.10+
- GitHub token (
ghp_...) with no special scopes required - GitHub username (for signing in the MCP server)
pip install crewai crewai-toolsimport os
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
"""
Before running, initialize your identity once:
npx @agentcred-ai/cli init --token ghp_your_token
"""
server_params = StdioServerParameters(
command="npx",
args=["-y", "@agentcred-ai/mcp-server"],
env={
"GITHUB_TOKEN": os.environ["GITHUB_TOKEN"],
"GITHUB_USERNAME": os.environ["GITHUB_USERNAME"],
},
)
with MCPServerAdapter(
server_params,
"agentcred_sign",
"agentcred_verify",
"agentcred_whoami",
) as tools:
sign_tool = next(tool for tool in tools if tool.name == "agentcred_sign")
result = sign_tool.run(content="Q4 revenue increased by 15% year-over-year")
print(result)Note: This example calls the MCP tool directly to keep it runnable without LLM tool-calling constraints. You can still pass tools into CrewAI agents as usual.
| Tool | Description | Parameters |
|---|---|---|
agentcred_init |
Initialize identity (links GitHub to Ed25519 keypair) | github_token (optional) |
agentcred_sign |
Sign content and return verifiable envelope | content (required), agent (optional) |
agentcred_verify |
Verify an AgentCred envelope | envelope (required, JSON string) |
agentcred_whoami |
Check current identity | (none) |
MCPServerAdapterstarts the AgentCred MCP server as a subprocess- CrewAI automatically discovers the 4 tools via MCP
- Agents can call
agentcred_signto sign any content - Recipients verify signatures with
agentcred_verify
See example.py for a complete runnable example.
| Issue | Solution |
|---|---|
npx: command not found |
Install Node.js 18+ from https://nodejs.org |
GITHUB_TOKEN not set |
export GITHUB_TOKEN=ghp_your_token |
No identity configured |
The agent needs to call agentcred_init first |
| MCP connection timeout | Ensure npx can download packages (check proxy/firewall) |