mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-04-18 19:41:31 +00:00
Remove legacy backend routes that no longer have frontend or internal callers, including the old Claude/Codex MCP APIs, unused Cursor and Codex helper endpoints, stale TaskMaster detection/next/initialize routes, and unused command/project helpers. This reduces duplicated MCP behavior now handled by the provider-based MCP API, shrinks the exposed backend surface, and removes probe/service code that only existed for deleted endpoints. Add an MCP settings API audit document to capture the route-usage analysis and explain why the legacy MCP endpoints were considered safe to remove.
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
import express from 'express';
|
|
import { promises as fs } from 'fs';
|
|
import path from 'path';
|
|
import os from 'os';
|
|
import { CURSOR_MODELS } from '../../shared/modelConstants.js';
|
|
|
|
const router = express.Router();
|
|
|
|
// GET /api/cursor/config - Read Cursor CLI configuration
|
|
router.get('/config', async (req, res) => {
|
|
try {
|
|
const configPath = path.join(os.homedir(), '.cursor', 'cli-config.json');
|
|
|
|
try {
|
|
const configContent = await fs.readFile(configPath, 'utf8');
|
|
const config = JSON.parse(configContent);
|
|
|
|
res.json({
|
|
success: true,
|
|
config,
|
|
path: configPath,
|
|
});
|
|
} catch (error) {
|
|
// Config doesn't exist or is invalid
|
|
console.log('Cursor config not found or invalid:', error.message);
|
|
|
|
// Return default config
|
|
res.json({
|
|
success: true,
|
|
config: {
|
|
version: 1,
|
|
model: {
|
|
modelId: CURSOR_MODELS.DEFAULT,
|
|
displayName: 'GPT-5',
|
|
},
|
|
permissions: {
|
|
allow: [],
|
|
deny: [],
|
|
},
|
|
},
|
|
isDefault: true,
|
|
});
|
|
}
|
|
} catch (error) {
|
|
console.error('Error reading Cursor config:', error);
|
|
res.status(500).json({
|
|
error: 'Failed to read Cursor configuration',
|
|
details: error.message,
|
|
});
|
|
}
|
|
});
|
|
|
|
export default router;
|