NpcpyBLOCK
The python library for research and development in NLP, multimodal LLMs, Agents, ML, Knowledge Graphs, and more.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
npcpy is a library that provides key primitives for research and development with multimodal language models, agentic AI, and knowledge graphs. Its flexible framework makes it easy to engineer powerful AI applications with support for local (ollama, llama.cpp, omlx, LM Studio) and cloud providers. Build multi-agent teams and simplify context engineering through the NPC Context-Agent-Tool data layer which ensures compliance through software rather than prompts.
pip install npcpy
Quick Examples
Create and use personas
from npcpy import NPC
simon = NPC(
name='Simon Bolivar',
primary_directive='''
Liberate South America
from the Spanish Royalists.
''',
model='qwen3.5:9b',
provider='ollama'
)
response = simon.get_llm_response("What is the most important territory to retain in the Andes?")
print(response['response'])My friend, you speak of the highlands where our liberty is carved in stone. If we must speak of the most critical territory to hold within these mountains, it is the **Viceroyalty of Peru** and the heart of the **Republic of Gran Colombia** united. To lose the passes of the Andes or the cities of Lima and Quito would be to hand the crown its final stronghold in the south. The Spanish crown built its power upon the wealt
c5eaf103bd2cOBSERVED · 2026-09-24Exposed tools (2)
1 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
add_numbers | write | Add two numbers together. |
echo_message | read | Echo back a message. |
Trust audit
BLOCKgrade F · trust 45/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (5 observation(s))
- Network
- declared (9 observation(s))
- Shell
- declared (8 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (25)
b64decode( ... subprocess.
classifiers = pickle.load(f)
exec(convert_script.read_text(), {"__name__": "__main__"})exec(rendered_code, exec_globals, exec_locals)
exec(generated_code, exec_globals, exec_locals)
".env" ... socket.create_connection
module = importlib.import_module(module_path)
key = random.choice(list(mutated.keys()))
child[key] = random.choice([p1.get(key), p2.get(key)])
api_url = api_url or "http://127.0.0.1:1234/v1"
api_url = api_url or "http://127.0.0.1:8080/v1"
api_url = api_url or "http://127.0.0.1:8000/v1"
response = requests.get('http://127.0.0.1:1234/v1/models', timeout=1)response = requests.get('http://127.0.0.1:8080/v1/models', timeout=1).readthedocs.yaml
.npcsh_global
exec(code, namespace)
exec(code, namespace)
cwd_hash = hashlib.md5(cwd.encode()).hexdigest()
cwd_hash = hashlib.md5(cwd.encode()).hexdigest()
fact_id = hashlib.md5(fact.encode()).hexdigest()
fact_id = hashlib.md5(statement.encode()).hexdigest()
chunk = base64.b64decode(data["audio"])
audio = base64.b64decode(event.get("delta", ""))audio = base64.b64decode(part["inlineData"].get("data", ""))Gates applied: critical_finding, no_behavioural_pass.
c5eaf103bd2cfull audit observations/trust-audit/mcp-server/npc-worldwide__npcpy-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-09-24 | c5eaf103bd2c | BLOCK | F | 45 | first audit |
Questions
What is the Npcpy MCP server?
The python library for research and development in NLP, multimodal LLMs, Agents, ML, Knowledge Graphs, and more.
What tools does Npcpy expose?
2 in total: 1 read-only, 1 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Npcpy safe to connect to an agent?
No — not without reading the findings first. The audit graded it F (45/100) and found 6 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does Npcpy need?
It reads ANTHROPIC_API_KEY, BRAVE_API_KEY, DEEPSEEK_API_KEY, ELEVENLABS_API_KEY, EXA_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, GROQ_API_KEY, HF_TOKEN, HUGGING_FACE_HUB_TOKEN, MINIMAX_API_KEY and OLLAMA_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Npcpy run?
It speaks stdio and streamable-http, so it runs as a local process your client starts.
How current is this page?
The grade is for one exact copy of the source (c5eaf103bd2c), read on 2026-09-24. The repository is watched and re-audited when it changes.