Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffb6294aa9 |
47
.cursorignore
Normal file
47
.cursorignore
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# Ignore node_modules directory
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Ignore build output directories
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Ignore environment variable files
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.development
|
||||||
|
.env.test
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# Ignore log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Ignore Docker files
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
|
||||||
|
# Ignore Jest coverage directory
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
# Ignore TypeScript declaration files
|
||||||
|
*.d.ts
|
||||||
|
|
||||||
|
# Ignore temporary files
|
||||||
|
*.tmp
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.bak
|
||||||
|
|
||||||
|
# Ignore IDE specific files
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Ignore OS generated files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
*.~lock.*
|
||||||
|
*.~undo-tree*
|
||||||
|
|
||||||
|
|
||||||
|
coverage/
|
||||||
36
.dockerignore
Normal file
36
.dockerignore
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# Dependencies
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
yarn-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# Build output
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Version control
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# IDE files
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Test files
|
||||||
|
coverage
|
||||||
|
__tests__
|
||||||
|
jest.config.js
|
||||||
|
jest.setup.js
|
||||||
|
*.test.ts
|
||||||
|
*.spec.ts
|
||||||
|
|
||||||
|
# Other
|
||||||
|
*.md
|
||||||
|
.DS_Store
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
.dockerignore
|
||||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Use Node.js 20.10.0 as the base image
|
||||||
|
FROM node:20.10.0-slim
|
||||||
|
|
||||||
|
# Create app directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Expose the port your app runs on (if needed)
|
||||||
|
# EXPOSE 3000
|
||||||
|
|
||||||
|
# Start the application
|
||||||
|
CMD ["npm", "start"]
|
||||||
@@ -7,5 +7,5 @@ export const HASS_CONFIG = {
|
|||||||
BASE_URL: process.env.HASS_HOST || 'http://homeassistant.local:8123',
|
BASE_URL: process.env.HASS_HOST || 'http://homeassistant.local:8123',
|
||||||
TOKEN: process.env.HASS_TOKEN || '',
|
TOKEN: process.env.HASS_TOKEN || '',
|
||||||
SOCKET_URL: process.env.HASS_SOCKET_URL || '',
|
SOCKET_URL: process.env.HASS_SOCKET_URL || '',
|
||||||
SOCKET_TOKEN: process.env.HASS_TOKEN || '',
|
SOCKET_TOKEN: process.env.HASS_SOCKET_TOKEN || '',
|
||||||
};
|
};
|
||||||
15
src/index.ts
15
src/index.ts
@@ -221,20 +221,7 @@ async function main() {
|
|||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
await server.start();
|
await server.start();
|
||||||
console.log('MCP Server started successfully and is ready to accept commands.');
|
console.log('MCP Server started');
|
||||||
// Add more detailed logging for server actions
|
|
||||||
server.on('toolAdded', (tool) => {
|
|
||||||
console.log(`Tool added: ${tool.name} - ${tool.description}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
server.on('toolExecuted', (tool, result) => {
|
|
||||||
console.log(`Tool executed: ${tool.name} - Result: ${result.success ? 'Success' : 'Failure'}`);
|
|
||||||
if (!result.success) {
|
|
||||||
console.error(`Error: ${result.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('Listening for incoming connections...');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch(console.error);
|
main().catch(console.error);
|
||||||
@@ -4,7 +4,16 @@
|
|||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "./src",
|
"rootDir": "./",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"paths": {
|
||||||
|
"@src/*": [
|
||||||
|
"src/*"
|
||||||
|
],
|
||||||
|
"@tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
@@ -18,21 +27,20 @@
|
|||||||
"jest"
|
"jest"
|
||||||
],
|
],
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types"
|
"./node_modules/@types",
|
||||||
|
"./node_modules/@types/node"
|
||||||
],
|
],
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2022"
|
"ES2022",
|
||||||
|
"DOM"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*"
|
"src/**/*",
|
||||||
|
"__tests__/**/*.test.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"dist",
|
"dist"
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"jest.config.js",
|
|
||||||
"jest.setup.js"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user