Skip to content

Commit 6903ed1

Browse files
author
Agent! for MacOS
committed
Remove diff tools and code editing tools from xcf MCP server
- Deleted XcfSwiftDiff.swift (diff operations) - Deleted XcfMcpDiffHandlers.swift (diff tool handlers) - Deleted XcfMcpXcodeDocumentHandlers.swift (ScriptingBridge doc tools) - Removed tool definitions from XcfMcpTools.swift - Removed handler cases from XcfMcpToolCallHandlers.swift - Removed constants from XcfMcpConfig.swift - Fixed unused variable warnings in XcfFileManager.swift and XcfSwiftScript.swift
1 parent 3f0e793 commit 6903ed1

10 files changed

Lines changed: 10 additions & 802 deletions

File tree

‎.DS_Store‎

0 Bytes
Binary file not shown.
Binary file not shown.

‎xcf/Mcp/File/XcfFileManager.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct XcfFileManager {
6161
/// - content: Initial content for the file
6262
/// - Throws: Error if file cannot be created
6363
static func createFile(at filePath: String, content: String) throws {
64-
let (resolvedPath, warning) = FuzzyLogicService.resolveFilePath(filePath)
64+
let (resolvedPath, _) = FuzzyLogicService.resolveFilePath(filePath)
6565

6666
guard !FileManager.default.fileExists(atPath: resolvedPath) else {
6767
throw NSError(domain: "XcfFileManager", code: 2, userInfo: [NSLocalizedDescriptionKey: String(format: ErrorMessages.fileAlreadyExists, filePath)])
@@ -95,7 +95,7 @@ struct XcfFileManager {
9595
/// - Parameter directoryPath: Path where the directory should be created
9696
/// - Throws: Error if directory cannot be created
9797
static func createDirectory(at directoryPath: String) throws {
98-
let (resolvedPath, warning) = FuzzyLogicService.resolveDirectoryPath(directoryPath)
98+
let (resolvedPath, _) = FuzzyLogicService.resolveDirectoryPath(directoryPath)
9999

100100
guard !FileManager.default.fileExists(atPath: resolvedPath) else {
101101
throw NSError(domain: "XcfFileManager", code: 2, userInfo: [NSLocalizedDescriptionKey: String(format: ErrorMessages.directoryAlreadyExists, directoryPath)])
@@ -138,7 +138,7 @@ struct XcfFileManager {
138138
}
139139

140140
// Now resolve the target path
141-
let (resolvedPath, warning) = FuzzyLogicService.resolveDirectoryPath(path)
141+
let (resolvedPath, _) = FuzzyLogicService.resolveDirectoryPath(path)
142142

143143
// Verify the target directory exists
144144
var isDirectory: ObjCBool = false

‎xcf/Mcp/Script/XcfSwiftDiff.swift‎

Lines changed: 0 additions & 186 deletions
This file was deleted.

‎xcf/Mcp/Script/XcfSwiftScript.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class XcfSwiftScript {
201201
}
202202

203203
// Use FileFinder to resolve the path
204-
let (resolvedPath, warning) = FileFinder.resolveFilePath(filePath)
204+
let (resolvedPath, _) = FileFinder.resolveFilePath(filePath)
205205

206206
// First check if the file exists on disk using FileManager
207207
if !FileManager.default.fileExists(atPath: resolvedPath) {
@@ -246,7 +246,7 @@ class XcfSwiftScript {
246246
}
247247

248248
// Use FileFinder to resolve the path
249-
let (resolvedPath, warning) = FileFinder.resolveFilePath(filePath)
249+
let (resolvedPath, _) = FileFinder.resolveFilePath(filePath)
250250

251251
// First create the file using FileManager
252252
do {
@@ -305,7 +305,7 @@ class XcfSwiftScript {
305305
}
306306

307307
// Use FileFinder to resolve the path
308-
let (resolvedPath, warning) = FuzzyLogicService.resolveFilePath(filePath)
308+
let (resolvedPath, _) = FuzzyLogicService.resolveFilePath(filePath)
309309

310310
// Find the document in Xcode
311311
guard let documents = xcode.documents?() else {

‎xcf/Mcp/ServerConfig/XcfMcpConfig.swift‎

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ struct McpConfig {
3636
moveFileToolName = "move_file",
3737
moveDirToolName = "move_dir"
3838

39-
// ScriptingBridge tool names
40-
static let openDocToolName = "open_doc",
41-
createDocToolName = "create_doc",
42-
readDocToolName = "read_doc",
43-
saveDocToolName = "save_doc",
44-
closeDocToolName = "close_doc"
45-
4639
// Tool descriptions
4740
static let listToolsDesc = "Lists all available tools on this server",
4841
xcfToolDesc = "Execute an \(AppConstants.appName) action or command",
@@ -64,14 +57,6 @@ struct McpConfig {
6457
moveFileToolDesc = "Move a file from one location to another",
6558
moveDirToolDesc = "Move a directory from one location to another"
6659

67-
// ScriptingBridge tool descriptions
68-
static let openDocToolDesc = "Open a document in Xcode",
69-
createDocToolDesc = "Create a new document in Xcode",
70-
readDocToolDesc = "Read document content from Xcode",
71-
saveDocToolDesc = "Save document in Xcode",
72-
73-
closeDocToolDesc = "Close a document in Xcode"
74-
7560
// Standalone action tool names
7661
static let showHelpToolName = "show_help",
7762
grantPermissionToolName = "grant_permission",
@@ -84,20 +69,6 @@ struct McpConfig {
8469
selectProjectToolName = "select_project",
8570
analyzeSwiftCodeToolName = "analyze_swift_code"
8671

87-
// Diff tool names
88-
static let createDiffFromDocToolName = "create_diff_from_doc",
89-
applyDiffToDocToolName = "apply_diff_to_doc",
90-
applyUndoDiffToDocToolName = "apply_undo_diff_to_doc",
91-
createDiff = "create_diff",
92-
applyDiff = "apply_diff",
93-
getAsciiDiff = "get_ascii_diff"
94-
95-
// Diff tool descriptions
96-
static let createDiffFromDocToolDesc = "Create a diff from a document and store it with a hash",
97-
applyDiffToDocToolDesc = "Apply a diff to a document using a stored diff hash",
98-
applyUndoDiffToDocToolDesc = "Apply undo diff to a document using a stored diff hash",
99-
getAsciiDiffToolDesc = "Get ASCII diff representation from a stored diff hash"
100-
10172
// Standalone action tool descriptions
10273
static let showHelpToolDesc = "Display help information about available commands",
10374
grantPermissionToolDesc = "Grant Xcode automation permissions",
@@ -122,10 +93,6 @@ struct McpConfig {
12293
selectProjectPromptName = "selectProject",
12394
analyzeSwiftCodePromptName = "analyzeSwiftCode"
12495

125-
// Diff tool parameter names
126-
static let diffHashParamName = "diffHash",
127-
diffHashParamDesc = "SHA256 hash of the diff to apply"
128-
12996
// Standalone action tool parameter names
13097
static let projectNumberParamName = "projectNumber",
13198
projectNumberParamDesc = "The number of the project to select",
@@ -206,13 +173,9 @@ struct McpConfig {
206173
integerType = "integer",
207174
booleanType = "boolean"
208175

209-
// DiffTools
210-
static let modifiedContentParamName = "modifiedContent",
211-
modifiedContentParamNameDesc = "modified content to the file"
212-
213176
// Snippet tool parameters
214-
static let filePathParamName = "filePath", // Use from Diff Tools
215-
filePathParamDesc = "Path to the file", // Use from Diff Tools
177+
static let filePathParamName = "filePath",
178+
filePathParamDesc = "Path to the file",
216179
startLineParamName = "startLine",
217180
startLineParamDesc = "Starting line number (1-indexed)",
218181
endLineParamName = "endLine",
@@ -295,13 +258,7 @@ struct McpConfig {
295258
directoryReadSuccessfully = "Directory read successfully",
296259
directorySelectedSuccessfully = "Directory selected successfully",
297260
directoryChangedSuccessfully = "Directory changed successfully",
298-
directoryRemovedSuccessfully = "Directory removed successfully",
299-
documentOpenedSuccessfully = "Document opened successfully",
300-
documentCreatedSuccessfully = "Document created successfully",
301-
documentReadSuccessfully = "Document read successfully",
302-
documentSavedSuccessfully = "Document saved successfully",
303-
documentEditedSuccessfully = "Document edited successfully",
304-
documentClosedSuccessfully = "Document closed successfully"
261+
directoryRemovedSuccessfully = "Directory removed successfully"
305262

306263
// Error messages
307264
static let errorChangingDirectory = "Error changing directory: %@",

0 commit comments

Comments
 (0)