Skip to main content
Glama

mcp-server-circleci

Official
handler.ts1.59 kB
import { ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js'; import { analyzeDiffInputSchema } from './inputSchema.js'; import { CircletClient } from '../../clients/circlet/index.js'; /** * Analyzes a git diff against cursor rules to identify rule violations * @param args - Tool arguments containing diff content and rules * @returns Analysis result with any rule violations found */ export const analyzeDiff: ToolCallback<{ params: typeof analyzeDiffInputSchema; }> = async (args) => { const { diff, rules, speedMode, filterBy } = args.params ?? {}; const circlet = new CircletClient(); if (!diff) { return { content: [ { type: 'text', text: 'No diff found. Please provide a diff to analyze.', }, ], }; } if (!rules) { return { content: [ { type: 'text', text: 'No rules found. Please add rules to your repository.', }, ], }; } const response = await circlet.circlet.ruleReview({ diff, rules, filterBy, speedMode, }); if (!response.isRuleCompliant) { return { content: [ { type: 'text', text: response.relatedRules.violations .map((violation) => { return `Rule: ${violation.rule}\nReason: ${violation.reason}\nConfidence Score: ${violation.confidenceScore}`; }) .join('\n\n'), }, ], }; } return { content: [ { type: 'text', text: `All rules are compliant.`, }, ], }; };

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/CircleCI-Public/mcp-server-circleci'

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