Skip to content

Commit 2d752ea

Browse files
authored
Merge pull request #41 from cameroncooke/graceful_shutdown
Graceful shutdown
2 parents 7274983 + 0633178 commit 2d752ea

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.vscode/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"servers": {
3-
"xcode-mcp-server-dev": {
3+
"xcodebuildmcp-dev": {
44
"type": "stdio",
55
"command": "node",
66
"args": [

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ VS Code is especially good for developing XcodeBuildMCP as it has a built-in way
6666

6767
To make your development workflow in VS Code more efficient:
6868

69-
1. **Start the MCP Server**: Open the `.vscode/mcp.json` file. You can start the `xcode-mcp-server-dev` server either by clicking the `Start` CodeLens that appears above the server definition, or by opening the Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`), running `Mcp: List Servers`, selecting `xcode-mcp-server-dev`, and starting the server.
69+
1. **Start the MCP Server**: Open the `.vscode/mcp.json` file. You can start the `xcodebuildmcp-dev` server either by clicking the `Start` CodeLens that appears above the server definition, or by opening the Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`), running `Mcp: List Servers`, selecting `xcodebuildmcp-dev`, and starting the server.
7070
2. **Launch the Debugger**: Press `F5` to attach the Node.js debugger.
7171

7272
Once these steps are completed, you can utilize the tools from the MCP server you are developing within this repository in agent mode.

src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ async function main(): Promise<void> {
5959
// Start the server
6060
await startServer(server);
6161

62+
// Clean up on exit
63+
process.on('SIGTERM', async () => {
64+
await server.close();
65+
process.exit(0);
66+
});
67+
68+
process.on('SIGINT', async () => {
69+
await server.close();
70+
process.exit(0);
71+
});
72+
6273
// Log successful startup
6374
log('info', `XcodeBuildMCP server (version ${version}) started successfully`);
6475
} catch (error) {

0 commit comments

Comments
 (0)