@hasna/projects
Version:
High-level project management CLI, MCP server, SDK, and AI SDK agent loop for coding agents
36 lines • 1.52 kB
TypeScript
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
/**
* projects MCP transport/port boilerplate.
* Keep this local and dependency-free so the published CLI can build without
* an unpublished workspace-only MCP harness package.
*/
export declare const MCP_HTTP_HOST = "127.0.0.1";
export declare const DEFAULT_MCP_HTTP_PORT = 8871;
export declare function mcpTokenConfigured(): boolean;
/**
* Token gate: with PROJECTS_MCP_TOKEN set, the request must carry a matching
* `Authorization: Bearer <token>`. Timing-safe compare; 401 otherwise.
*/
export declare function mcpAuthorized(req: Request): boolean;
/**
* Fixed allowlist, never derived from the request: a DNS-rebinding request
* carries the ATTACKER's Host header, so host validation only works when the
* accepted set is the server's own loopback addresses.
*/
export declare function mcpAllowedHosts(hostname: string, port: number): string[];
export declare function isHttpMode(args?: readonly string[]): boolean;
export declare function isStdioMode(args?: readonly string[]): boolean;
export declare function resolveMcpHttpPort(args?: readonly string[]): number;
export declare function handleMcpRequest(req: Request, buildServer: () => McpServer, options?: {
port?: number;
hostname?: string;
}): Promise<Response>;
export declare function startMcpHttpServer(options: {
name: string;
port: number;
buildServer: () => McpServer;
}): {
port: number;
stop: () => void;
};
//# sourceMappingURL=http.d.ts.map