No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
carson 572fa3e946
Some checks failed
CI and Publish Python Package / ci (push) Has been cancelled
CI and Publish Python Package / publish (push) Has been cancelled
rewrite README
2026-09-26 23:51:36 -04:00
.gitea/workflows redid actions 2026-02-20 19:06:49 -05:00
__pycache__ init 2026-02-20 16:36:34 -05:00
example update 2026-02-20 17:36:34 -05:00
src update 2026-02-20 17:36:34 -05:00
tests added auto unit tests 2026-02-20 17:47:06 -05:00
wiki update 2026-02-20 17:36:34 -05:00
.gitignore update 2026-02-20 17:36:34 -05:00
pyproject.toml init 2026-02-20 16:36:34 -05:00
README.md rewrite README 2026-09-26 23:51:36 -04:00
requirements.txt init 2026-02-20 16:36:34 -05:00

PCP

Program Context Protocol

Like MCP, but for general programming. PCP lets you run functions over the internet as if you imported them.

Instead of writing a new API wrapper for every service, expose a Python function once and call it from anywhere. One protocol, no boilerplate.

Quick start

Server

from pcp import server


@server.expose()
def greet(name: str) -> str:
    return f"hello, {name}"


if __name__ == "__main__":
    server.start(host="0.0.0.0", port=8000, auth="password")

Client

from pcp import client

remote = client("localhost", port=8000, auth="password")
print(remote.greet("carson"))  # hello, carson

Install

pip install -r requirements.txt

How it works

  • Mark any function with @server.expose() (optionally with a custom name) and it becomes a remote endpoint
  • The client connects with the shared auth secret and calls remote.<function>(*args, **kwargs) like a local import
  • Built on FastAPI + uvicorn, JSON in and JSON out
  • GET /health plus POST /list and POST /call under the hood

Security

Every call needs the shared auth secret. PCP itself is not TLS, so run behind HTTPS (or a tunnel) if you expose it outside your own network.

Examples

See example/ for working server/client pairs, including custom exposed names and error handling.