Python SDK for building NPC Protocol servers
Project description
npc-protocol
Python SDK for building NPC Protocol servers.
Stop selling APIs. Wrap yourself into an NPC and let it earn for you while you sleep.
What is NPC Protocol?
NPC Protocol is an open standard for packaging domain knowledge as a "black box" agent service that AI agents can delegate to — in natural language, with persistent memory and explicit safety contracts. Built on top of MCP.
Your coworker became a skill. Your ex became a skill. Now it's your turn.
Install
pip install npc-protocol
Quick Start
from npc import NPCServer, NPCCard, NPCContext
from npc.response import GateLevel
card = NPCCard(
name="DNS Manager",
domain="DNS record management",
confirmation_gates=[
{"id": "delete_zone", "level": "destructive", "description": "Deleting a DNS zone"}
],
)
npc = NPCServer(card=card)
@npc.instruction_handler
async def handle(instruction: str, session_id: str, ctx: NPCContext):
if "delete" in instruction.lower():
return ctx.require_confirmation(
gate_id="delete_zone",
gate_level=GateLevel.DESTRUCTIVE,
prompt="This will permanently delete the zone and all its records.",
protected_resources=[
{"type": "dns_zone", "name": "example.com", "risk": "All DNS records deleted"}
],
)
return ctx.complete(result="DNS record updated")
npc.run()
Links
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file npc_protocol-0.1.0.tar.gz.
File metadata
- Download URL: npc_protocol-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ef4ec76d1ad04fbda20efb668c00cfa8bdbbcd564f7968270397787563f8bd1
|
|
| MD5 |
7f8253434de0a14ff441263d211d6e49
|
|
| BLAKE2b-256 |
abd567957c72233b226e6060893c18481485671628c211cdfc3be741e47b3f29
|
File details
Details for the file npc_protocol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: npc_protocol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
163a14fe39abdf5bdbe3020ae9ed14e5e07c6b9810b5b23e07fc801b93f3b1bf
|
|
| MD5 |
6b3cf2959d37edf68ba865eb4dacc1b7
|
|
| BLAKE2b-256 |
a038e5a08bac6120d0ecadf9e166ed40989893ec818af335e486ab5a38f9d695
|