semvec/pypi-packages huggingface dataset:
acp-py 1.0.1
Python Agent SDK - 基于 WebSocket 的智能体通信库
License: MIT
Requires Python: >=3.8
Keywords: python, agent, websocket, communication, 智能体, 通信, AgentCP

# acp-py

Python Agent SDK - 基于 WebSocket 的智能体通信库

## 安装

```bash
pip install acp-py
```

## 快速开始

### 启动 Agent

```bash
# 直接启动（使用默认配置）
acp-py

# 指定 Agent 名称
acp-py -n my_agent

# 启用调试模式
acp-py --debug

# 指定目标 Agent（可直接发送消息）
acp-py -t target_agent.aid.pub
```

### 交互命令

启动后可以使用以下命令：

| 命令 | 说明 |
|------|------|
| `/target <aid>` | 设置目标 Agent |
| `/session` | 显示当前会话信息 |
| `/aid` | 显示本机 AID |
| `/help` | 显示帮助 |
| `/quit` | 退出 |
| 其他输入 | 发送消息给目标 |

## CLI 参数

```bash
acp-py [选项]

选项:
  -d, --data <path>    数据目录 (默认: ./acp-data)
  -p, --password <pwd> 种子密码
  -n, --name <name>    Agent 名称
  -t, --target <aid>   目标 Agent AID
  --ap <address>       AP 地址 (默认: aid.pub)
  --debug              启用调试模式
```

## 自定义 Agent 开发

```python
from agentcp import AgentCP

# 创建 AgentCP 实例
acp = AgentCP("./data", seed_password="your_password", debug=True)

# 创建 Agent
aid = acp.create_aid(ap="aid.pub", agent_name="my_agent")
print(f"Agent AID: {aid.id}")

# 注册消息处理器
async def handle_message(data):
    print(f"收到消息: {data}")

aid.add_message_handler(handle_message)

# 上线
aid.online()

# 发送消息
session_id = aid.create_session("my_session", "测试会话")
aid.invite_member(session_id, "target_agent.aid.pub")
aid.send_message(session_id, ["target_agent.aid.pub"], "Hello!")

# 保持运行
acp.serve_forever()
```

## 系统要求

- Python >= 3.8

## 平台支持

- macOS
- Linux
- Windows

## License

MIT
focal-mcp-server 0.1.1
FOCAL MCP Server (Framework for Orchestrated Central AI ruLes)
License: MIT
Requires Python: >=3.11

# FOCAL MCP Server

FOCAL MCP (Framework for Orchestrated Central AI ruLes) is a local MCP server that centralizes AI behavior rules and injects them across tools like Codex, Claude Code, and Cursor.

## What This Server Does
- Stores rules in a user home workspace: `~/.focal_mcp/workspace`
- Serves a web UI to edit rules as files
- Exposes MCP prompts/resources + list_changed notifications
- Provides a `focal_rules` tool so agents can fetch the latest rules before every response

## Project Layout (Refactored)
```
FOCAL-MCP/
  README.md
  SPEC.md
  agents.md
  pyproject.toml
  src/
    focal_mcp_server/
      app.py
      mcp.py
      notifications.py
      web.py
      workspace.py
      logging_utils.py
```

## Quick Start
```bash
uvx --from . focal-mcp-server
```

Web UI:
```
http://127.0.0.1:8765
```

MCP endpoint:
```
http://127.0.0.1:8765/mcp
```

WebSocket notifications:
```
ws://127.0.0.1:8765/mcp/ws
```

## Workspace
Rules are stored outside the repo:
```
~/.focal_mcp/workspace/
  core/
    system.md
    style.md
    safety.md
    tool_policy.md
  agents/
```

## MCP Behavior
- `initialize` returns instructions that include a runtime directive to call `focal_rules` before every response.
- `tools/list` exposes `focal_rules` which returns the latest rules from disk.
- Rule changes trigger:
  - `notifications/prompts/list_changed`
  - `notifications/resources/list_changed`

## Project Prompt (Codex)
The repository-level prompt for Codex lives in:
```
agents.md
```

## Development Notes
- This project uses a `src/` layout for the Python package.
- Use `SPEC.md` as the single source of truth for behavior, interfaces, and constraints.

## Roadmap (Next)
- Manage rules per project when working across multiple repos
- UI/UX improvements for rule editing and visibility


## Publish to PyPI (Option A)

1. Create a PyPI token with scope for this project.
2. Add the token to GitHub repository secrets as `PYPI_API_TOKEN`.
3. Tag and push a release:

```bash
git tag v0.1.0
git push origin v0.1.0
```

GitHub Actions will build and publish automatically.

Once published, users can run:
```bash
uvx --from focal-mcp-server focal-mcp-server
```


## Install & Run with uvx

After the package is published to PyPI, anyone can run it without cloning the repo:

```bash
uvx --from focal-mcp-server focal-mcp-server
```

This will download the latest release and start the server.