Skip to content

Commit 83713f5

Browse files
committed
Document saved log inspection flow
1 parent 31ea2c0 commit 83713f5

6 files changed

Lines changed: 34 additions & 6 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Minimal MCP server for discovering Xcode Cloud products and workflows, then retr
1717
- List recent workflow runs with `list_build_runs`.
1818
- Retrieve build issue counts with `get_build_issues`.
1919
- Retrieve and summarize text-like build logs with `get_build_logs`.
20+
- Save extracted logs to a local temporary directory and return file paths for agent-side inspection.
2021
- Retrieve test summaries with `get_test_results`.
2122
- Retrieve screenshots, videos, result bundles, and test products with `get_test_artifacts`.
2223

@@ -73,12 +74,39 @@ codex mcp add xcode-cloud \
7374
- `get_test_results(buildRunId? workflowId? buildNumber? buildSelector?)`
7475
- `get_test_artifacts(buildRunId? workflowId? buildNumber? buildSelector?)`
7576

77+
## Log Retrieval Behavior
78+
79+
`get_build_logs` keeps the MCP response compact on purpose:
80+
81+
- it downloads and extracts text-like build log artifacts to a temporary local directory
82+
- it returns `savedLogsDirectory` and `savedLogs` so local agents can inspect the extracted files with `rg`, `grep`, or `cat`
83+
- it returns a compact `failedTests` summary, `highlights`, and a capped `excerpt`
84+
- even if a caller passes a very large `maxCharacters`, the inline excerpt is clamped to avoid oversized MCP responses
85+
86+
Temporary logs are written under the system temp directory in a path like:
87+
88+
```text
89+
/tmp/xcode-cloud-mcp/build-logs/<buildRunId>
90+
```
91+
92+
On macOS this typically resolves to a path under `/var/folders/.../T/`.
93+
94+
Cleanup policy:
95+
96+
- each new call for the same `buildRunId` deletes and recreates that build-specific temp directory first
97+
- older build directories are not explicitly garbage-collected by the server yet
98+
- they are left in the system temp area, where the OS may eventually clean them up
99+
76100
## Example Prompts
77101

78102
```text
79103
Retrieve logs of the latest failing build for workflow abc123.
80104
```
81105

106+
```text
107+
Retrieve logs of build 81, then inspect the returned savedLogsDirectory and grep for Expectation failed.
108+
```
109+
82110
```text
83111
Retrieve logs of build number 42 for workflow abc123.
84112
```

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thatfactory/xcode-cloud-mcp",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Minimal MCP server for discovering Xcode Cloud workflows and retrieving build logs, issues, and test artifacts.",
55
"license": "MIT",
66
"type": "module",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function createServer(): McpServer {
2222

2323
const server = new McpServer({
2424
name: 'Xcode Cloud MCP',
25-
version: '0.1.1',
25+
version: '0.1.2',
2626
});
2727

2828
registerDiscoveryTools(server, client);

src/tools/results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function registerResultTools(
5050
'get_build_logs',
5151
{
5252
description:
53-
'Resolve a build, download text-like log artifacts when possible, and summarize the most relevant errors and warnings.',
53+
'Resolve a build, download text-like log artifacts, save them under a temporary local directory, and return a compact summary with failed tests, highlights, and saved log paths that local agents can inspect with grep or cat.',
5454
inputSchema: {
5555
...buildLookupSchema(),
5656
maxCharacters: z.number().int().positive().max(100_000).optional(),

src/tools/tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function registerTestTools(
3131
'get_test_results',
3232
{
3333
description:
34-
'Resolve a build and return build-level test summary information plus result bundle metadata.',
34+
'Resolve a build and return build-level test summary information, saved local log paths, detected failed tests, and result bundle metadata.',
3535
inputSchema: buildLookupSchema(),
3636
},
3737
async (input: BuildLookupInput) => {

0 commit comments

Comments
 (0)