{"id":44972375,"url":"https://github.com/hiddenpath/ai-protocol-mock","last_synced_at":"2026-02-21T02:02:19.629Z","repository":{"id":339201960,"uuid":"1160291037","full_name":"hiddenpath/ai-protocol-mock","owner":"hiddenpath","description":"Unified mock server for AI-Protocol runtimes - HTTP provider and MCP JSON-RPC mocking","archived":false,"fork":false,"pushed_at":"2026-02-18T14:49:14.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-18T18:22:45.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiddenpath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-17T19:09:32.000Z","updated_at":"2026-02-17T19:09:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hiddenpath/ai-protocol-mock","commit_stats":null,"previous_names":["hiddenpath/ai-protocol-mock"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hiddenpath/ai-protocol-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddenpath%2Fai-protocol-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddenpath%2Fai-protocol-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddenpath%2Fai-protocol-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddenpath%2Fai-protocol-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiddenpath","download_url":"https://codeload.github.com/hiddenpath/ai-protocol-mock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddenpath%2Fai-protocol-mock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-18T16:03:34.194Z","updated_at":"2026-02-21T02:02:19.617Z","avatar_url":"https://github.com/hiddenpath.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ai-protocol-mock\n\nUnified mock server for AI-Protocol runtimes. Provides HTTP provider mock (OpenAI and Anthropic formats) and MCP JSON-RPC mock for testing ai-lib-python, ai-lib-rust, and other runtimes.\n\n## Features\n\n- **Manifest-driven HTTP mock**: Generates responses in OpenAI or Anthropic format based on provider manifests\n- **MCP JSON-RPC mock**: Implements `tools/list`, `tools/call`, `capabilities`, `initialize`\n- **Configurable**: Response delay, error rate, mock content via environment variables\n- **Docker**: One-command startup with `docker-compose up`\n\n## Quick Start\n\n```bash\n# Install and run\npip install -e .\npython scripts/sync_manifests.py --force  # Sync manifests from ai-protocol\nuvicorn ai_protocol_mock.main:app --host 0.0.0.0 --port 4010\n```\n\nOr with Docker:\n\n```bash\ndocker-compose up -d\n```\n\n## Configuration\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| HTTP_PORT | 4010 | Port for HTTP and MCP (MCP at /mcp) |\n| MANIFEST_DIR | manifests | Directory for synced manifests |\n| MANIFEST_SYNC_URL | https://raw.githubusercontent.com/hiddenpath/ai-protocol/main/ | Source for manifest sync |\n| RESPONSE_DELAY | 0 | Delay in seconds before responding |\n| ERROR_RATE | 0 | Probability (0-1) of returning 429/500/503 |\n| MOCK_CONTENT | Mock response from ai-protocol-mock | Default response content |\n\n## Endpoints\n\n- `POST /v1/chat/completions` - OpenAI-format chat\n- `POST /v1/messages` - Anthropic-format chat\n- `POST /mcp` - MCP JSON-RPC (tools/list, tools/call, capabilities)\n- `GET /health` - Health check\n- `GET /status` - Status with manifest sync metadata\n\n## Using with ai-lib-python\n\n```python\nimport os\nos.environ[\"MOCK_HTTP_URL\"] = \"http://localhost:4010\"\n\nfrom ai_lib_python.client import AiClient\nfrom ai_lib_python.types.message import Message\n\nclient = await AiClient.create(\n    \"openai/gpt-4o\",\n    api_key=\"sk-test\",\n    base_url=\"http://localhost:4010\"\n)\nresponse = await client.chat().messages([Message.user(\"Hi\")]).execute()\nprint(response.content)\n```\n\n## Using with ai-lib-rust\n\n```bash\nexport MOCK_HTTP_URL=http://localhost:4010\ncargo run --example basic_usage\n```\n\nOr in code:\n\n```rust\nlet client = AiClientBuilder::new()\n    .base_url_override(\"http://localhost:4010\")\n    .build(\"openai/gpt-4o\")\n    .await?;\n```\n\n## Manifest Sync\n\nSync manifests from the ai-protocol repository:\n\n```bash\npython scripts/sync_manifests.py [--force] [--url URL]\n```\n\nRun before starting the server to ensure manifests are up to date. Docker Compose runs sync automatically on startup.\n\n## License\n\nMIT OR Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiddenpath%2Fai-protocol-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiddenpath%2Fai-protocol-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiddenpath%2Fai-protocol-mock/lists"}