feat: Initial NPM MCP server implementation

- NpmClient with JWT auth and auto-refresh
- FastMCP server with 5 tools (list_proxy_hosts, get_proxy_host_details, get_system_health, search_audit_logs, list_certificates)
- Docker support with multi-stage build using uv
- Supports stdio and streamable HTTP transports
- GitHub Actions for tests and Docker builds
This commit is contained in:
Ben
2025-12-18 03:16:49 +00:00
commit 18b76b673b
19 changed files with 2080 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
"""Custom exceptions for NPM API client."""
class NpmClientError(Exception):
"""Base exception for NPM client errors."""
pass
class NpmAuthenticationError(NpmClientError):
"""Raised when authentication fails."""
pass
class NpmConnectionError(NpmClientError):
"""Raised when connection to NPM fails."""
pass
class NpmNotFoundError(NpmClientError):
"""Raised when a resource is not found."""
pass
class NpmApiError(NpmClientError):
"""Raised for general API errors."""
def __init__(self, message: str, status_code: int | None = None):
super().__init__(message)
self.status_code = status_code