An AI service proxy server with support for custom forwarding interfaces, featuring a clean architecture and flexible configuration system after refactoring.
The new proxy system supports: - Custom forwarding endpoints via YAML configuration files - Custom request and response headers per endpoint - Multiple response types: JSON, SSE, streaming, HTML - Dynamic route registration
endpoints:
- path: "/api/provider/openai/v1/chat/completions"
target_url: "https://api.openai.com/v1/chat/completions"
method: "POST"
response_type: "stream"
custom_headers: {}
forward_request_headers:
- "authorization"
- "content-type"
forward_response_headers:
- "content-type"
enabled: true
HOST: Server bind hostPORT: Server portAMP_API_KEY: AMP service authentication keyRUST_LOG: Log levelcargo run
proxy_config.yaml filepath: Local route pathtarget_url: Target forwarding URLmethod: HTTP method (GET, POST, PUT, DELETE)response_type: Response type (json, sse, stream, html)custom_headers: Custom request headersforward_request_headers: List of request headers to forwardforward_response_headers: List of response headers to forwardenabled: Whether this endpoint is enabled/api/provider/openai/v1/chat/completions - OpenAI compatible interface/api/provider/anthropic/v1/messages - Anthropic compatible interface/api/tab/llm-proxy - LLM proxy interfaceGET /api/user - Get user informationGET /api/connections - Get connection listPOST /api/threads/sync - Sync conversationsPOST /api/internal - Internal interfacePOST /api/telemetry - Send telemetry datacargo build
cargo test
cargo check
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 YougLin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
$ claude mcp add amp-server \
-- python -m otcore.mcp_server <graph>