Skip to main content
Glama

MCP Server for Spinnaker

by dion-hagan
ModelContextProtocolServer.ts1.62 kB
import { Request, Response } from 'express'; import { ContextResponse, SetContextRequest } from '../types/protocol.js'; import { ContextManager } from './ContextManager.js'; import { CommandHandler } from './CommandHandler.js'; import { GateClient } from '../clients/GateClient.js';export class ModelContextProtocolServer { private contextManager: ContextManager; private commandHandler: CommandHandler; constructor( gateUrl: string, applications: string[], environments: string[] ) { const gateClient = new GateClient(gateUrl); this.contextManager = new ContextManager(gateClient, applications, environments); this.commandHandler = new CommandHandler(gateClient); } async initialize(): Promise<void> { await this.contextManager.initialize(); } async handleGetContext(req: Request, res: Response): Promise<void> { const context = this.contextManager.getContext(); const refreshSeconds = this.contextManager.getRecommendedRefreshInterval(); const response: ContextResponse = { context, refresh_in_seconds: refreshSeconds }; res.json(response); } async handleSetContext(req: Request, res: Response): Promise<void> { const setContextRequest = req.body as SetContextRequest; // For now, we don't allow external context updates // Could potentially allow setting of watched applications/environments res.status(200).json({ status: 'success' }); } async handleCommand(req: Request, res: Response): Promise<void> { const result = await this.commandHandler.handleCommand(req.body); res.json(result); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dion-hagan/mcp-server-spinnaker'

If you have feedback or need assistance with the MCP directory API, please join our Discord server