Skip to content

Commit 53b09a9

Browse files
committed
Pull version from Package
1 parent 5f8badc commit 53b09a9

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ dist/
99
build/
1010
*.tsbuildinfo
1111

12+
# Auto-generated files
13+
src/version.ts
14+
1215
# IDE and editor files
1316
.idea/
1417
.vscode/

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ https://github.com/user-attachments/assets/e3c08d75-8be6-4857-b4d0-9350b26ef086
148148
node build/index.js
149149
```
150150

151+
### Configure your MCP client
152+
153+
To configure your MCP client to use the local XcodeBuildMCP server, add the following configuration:
154+
155+
```json
156+
{
157+
"mcpServers": {
158+
"XcodeBuildMCP": {
159+
"command": "node",
160+
"args": [
161+
"/path_to/XcodeBuildMCP/build/index.js"
162+
]
163+
}
164+
}
165+
}
166+
```
167+
168+
Remember after making changes to the server implemetation you'll need to rebuild and restart the server.
169+
170+
```bash
171+
npm run build
172+
node build/index.js
173+
```
174+
151175
### Debugging
152176

153177
You can use MCP Inspector via:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"xcodebuildmcp": "./build/index.js"
88
},
99
"scripts": {
10+
"prebuild": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
1011
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
1112
"lint": "eslint 'src/**/*.{js,ts}'",
1213
"lint:fix": "eslint 'src/**/*.{js,ts}' --fix",

src/server/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
22
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
33
import { log } from '../utils/logger.js';
4+
import { version } from '../version.js';
45

56
/**
67
* Create and configure the MCP server
@@ -11,7 +12,7 @@ export function createServer(): McpServer {
1112
const server = new McpServer(
1213
{
1314
name: 'xcodebuildmcp',
14-
version: '1.0.0',
15+
version,
1516
},
1617
{
1718
capabilities: {
@@ -24,7 +25,7 @@ export function createServer(): McpServer {
2425
);
2526

2627
// Log server initialization
27-
log('info', 'Server initialized');
28+
log('info', `Server initialized (version ${version})`);
2829

2930
return server;
3031
}

0 commit comments

Comments
 (0)