Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2025-04-02

### Fixed
- Fixed logs directory creation issue where logs were being created in the root directory instead of the application directory
- Updated both index.ts and mcp-server.ts to use ESM equivalent of __dirname instead of process.cwd()

## [1.0.0] - 2025-03-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mcp-server-simulator-ios-idb",
"version": "1.0.0",
"version": "1.0.1",
"description": "Model Context Protocol server for iOS simulator automation via IDB",
"main": "dist/index.js",
"type": "module",
Expand Down
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ console.debug = () => {};

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import mcpServer from './mcp/mcp-server.js';

/**
Expand Down Expand Up @@ -79,7 +80,12 @@ export function createMCPServer() {

// Create logs directory with error handling
try {
const logsDir = path.join(process.cwd(), 'logs');
// Get the directory name using ESM approach
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Go up one level from the src directory to the project root
const logsDir = path.join(__dirname, '..', 'logs');

if (!fs.existsSync(logsDir)) {
fs.mkdirSync(logsDir, { recursive: true });
}
Expand Down
9 changes: 7 additions & 2 deletions src/mcp/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import {
} from '@modelcontextprotocol/sdk/types.js';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

import { createMCPServer } from '../index.js';

// Log configuration
const logsDir = path.join(process.cwd(), 'logs');
// Get the directory name using ESM approach
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Go up two levels from the src/mcp directory to the project root
const logsDir = path.join(__dirname, '..', '..', 'logs');
if (!fs.existsSync(logsDir)) {
fs.mkdirSync(logsDir, { recursive: true });
}
Expand Down Expand Up @@ -46,7 +51,7 @@ class MCPSimulatorServer {
this.server = new Server(
{
name: 'iOS Simulator MCP Server',
version: '1.0.0',
version: '1.0.1',
},
{
capabilities: {
Expand Down
Loading