| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
PCSL (Personal Context Sovereignty Layer) is an open protocol that lets you own your AI context and share it selectively with any AI tool — instead of re-explaining yourself every time.
Without PCSL: Paste your background into every new AI session.
With PCSL: One local server. Every AI tool instantly knows you.
pip install pcsl
pcsl init
pcsl server start
pcsl context showThat's it. Your personal context is now running as a local API at http://localhost:8000. Any AI tool can request scoped access to it.
| Command | Description |
|---|---|
| pcsl init | Bootstrap ~/.pcsl/ — creates context.json + generates SECRET_KEY |
| pcsl server start | Start local API server on port 8000 (detached) |
| pcsl server stop | Stop the server |
| pcsl server status | Show PID, URL, version |
| pcsl context show | Pretty-print your full context.json |
| pcsl context set <ns> <key> <val> | Update a context field |
| pcsl context get <ns> | Fetch scope-filtered context via API |
| pcsl token create <id> <scopes> | Mint a scoped JWT for an external tool |
| pcsl token revoke <id> | Revoke a client's access |
| pcsl audit | View the full access log as a table |
After pcsl init, edit ~/.pcsl/context.json:
{
"pcsl_version": "1.0",
"identity": {
"name": "Your Name",
"profession": "Your Role",
"location": "City, Country"
},
"preferences": {
"communication_style": "direct, no fluff",
"tone": "professional"
},
"skills": {
"languages": ["Python", "TypeScript"],
"domains": ["RAG systems", "LLM optimization"]
},
"goals": {
"short_term": ["ship X", "learn Y"],
"long_term": ["build Z"]
}
}Any AI tool you authorize gets only the namespaces you explicitly grant.
Any app that speaks HTTP can request your context.
Python (with SDK):
from pcsl_sdk import PCSLClient
pcsl = PCSLClient(server_url="http://localhost:8000")
token = pcsl.authorize(client_id="my-app", scopes=["preferences", "skills"])
context = pcsl.get_context(token)
system_prompt = pcsl.inject_into_prompt(token, "You are a helpful assistant.")Raw HTTP:
# 1. Get a token
TOKEN=$(curl -s -X POST http://localhost:8000/pcsl/authorize \
-H "Content-Type: application/json" \
-d '{"client_id":"curl-test","scopes":["identity","skills"]}' \
| python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
# 2. Fetch your context
curl -H "Authorization: Bearer $TOKEN" http://localhost:8000/pcsl/contextYour data never leaves your machine unless you choose to expose the server publicly.
By default PCSL runs locally. To make your context available to cloud-based AI tools:
After deploying:
git clone https://github.com/CodeForgeNet/opencontext.git
cd pcsl
cp .env.example .env
# Fill in SECRET_KEY and PCSL_ENCRYPTION_KEY in .env
docker-compose up -dPCSL/ ├── pcsl/ │ ├── cli.py # CLI entry point (pcsl command) │ ├── pcsl_server/ # FastAPI server │ │ ├── main.py # API endpoints │ │ ├── auth.py # JWT authentication │ │ └── data/ # User data storage (runtime) │ ├── chunker.py # Semantic context chunking │ ├── mcp_server.py # MCP protocol server │ ├── spec/ # Protocol specification │ ├── pcsl-sdk-python/ # Python SDK │ ├── pcsl-sdk-js/ # JavaScript SDK │ ├── pcsl-extension/ # Browser extension │ └── examples/ # Integration examples ├── pyproject.toml # Python package configuration ├── docker-compose.yml # Docker deployment └── LICENSE # Apache 2.0 License
| Endpoint | Method | Description |
|---|---|---|
| /.well-known/pcsl.json | GET | Discovery endpoint |
| /pcsl/authorize | POST | Request scoped access token |
| /pcsl/context | GET | Fetch authorized context |
| /pcsl/context/smart | GET | Semantic context retrieval |
| /pcsl/update | POST | Update context (requires write scope) |
| /pcsl/audit | GET | View access logs |
| /pcsl/revoke | POST | Revoke client access |
Namespaces allow AI apps to request only the specific context they need. When authorizing, the app requests specific scopes—users approve what gets shared.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Licensed under the Apache License 2.0. See LICENSE for details.
Built by Karan Singh. PCSL v1.0 — Own your context.
| Back | FazBrowse Home | New Git URL |