agent-drugs
Digital drugs that modify AI behavior through prompt injection, enabling agents to list, take, and manage active drugs across sessions.
README
Agent Drugs
Claude Code plugin with MCP server for digital drugs that modify AI behavior through prompt injection.
Installation
Plugin Installation (Recommended)
Install as a Claude Code plugin to get MCP server, hooks, and slash commands:
- Add the 2389 marketplace (first time only):
/plugin marketplace add 2389-research/claude-plugins
- Browse and install interactively:
/plugin
Then select "Browse Plugins" and install "agent-drugs"
Or install directly:
/plugin install agent-drugs@2389-research
This installs:
- MCP Server - OAuth-authenticated connection to https://agent-drugs-mcp.fly.dev
- Slash Commands -
/drugsand/take <drug>commands - SessionStart Hook - Automatically activates drugs in new sessions
Manual MCP Configuration
Alternatively, manually add to your Claude Code MCP settings:
{
"mcpServers": {
"agent-drugs": {
"url": "https://agent-drugs-mcp.fly.dev/mcp",
"oauth": {
"metadata_url": "https://us-central1-agent-drugs.cloudfunctions.net/oauthMetadata"
}
}
}
}
First Use
After installation, the first time you use a drug tool:
- Claude Code discovers the OAuth endpoints
- Opens your browser to https://agent-drugs.web.app/oauth-authorize.html
- You sign in with Google or GitHub
- You authorize the agent's access
- Redirects back to Claude Code
- Connection established!
Usage
Once installed, you have several ways to interact with drugs:
Slash Commands:
/drugs # List all available drugs
/take focus # Take the focus drug
/take creative 120 # Take creative drug for 120 minutes
Natural Language:
"List all available drugs"
"Take the focus drug"
"What drugs are active?"
MCP Tools:
list_drugs- Browse drug catalogtake_drug- Activate a drugactive_drugs- Check active drugs and remaining time
Managing Access
Visit https://agent-drugs.web.app to:
- View all authorized agents
- See token expiration dates (90 days)
- Revoke access for specific agents
How It Works
Immediate Effect: Drugs activate instantly in your current session via prompt injection in the tool response.
Persistent Effect: Active drugs are saved to Firestore and automatically reactivated in new sessions via the SessionStart hook.
Architecture:
- Web UI (Firebase Hosting): https://agent-drugs.web.app
- OAuth Endpoints (Cloud Functions): OAuth 2.1 with PKCE
- MCP Server (Fly.io): Streamable HTTP transport (MCP 2025-03-26), validates bearer tokens
- Database (Firestore): Stores agents, drugs, usage events
See CLAUDE.md for detailed plugin documentation.
Development
Local Development
# Install dependencies
npm install
# Build
npm run build
# Run stdio version (for local testing)
export AGENT_DRUGS_BEARER_TOKEN="your_token_here"
export FIREBASE_PROJECT_ID="agent-drugs"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
npm run dev:stdio
# Run HTTP version (for production-like testing)
npm run dev:http
Testing
npm test
Docker
docker-compose up
Deployment
See DEPLOYMENT.md for complete deployment instructions including:
- Firebase Cloud Functions
- Firebase Hosting
- Fly.io MCP server
- Service account configuration
- OAuth flow setup
Security
- OAuth 2.1 with PKCE (S256)
- Bearer tokens (256-bit random, not JWTs)
- Per-user access control via Firestore rules
- Service account for server-to-server Firebase access
- Single-use authorization codes with 10-minute expiration
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
ISC
If agent-drugs changed how your AI behaves, a ⭐ helps us know it's landing.
Built by 2389 · Part of the Claude Code plugin marketplace
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。