Skip to content

Commit 79bd0b7

Browse files
github-actions[bot]AbdallahAHOsmithery[bot]
authored
Release v1.0.3 (#13)
## 🚀 Release v1.0.3 ### Release Type: patch ### Pre-release Checklist - [x] Version updated in all files - [x] CHANGELOG.md updated - [x] Tests passing - [x] DXT package created - [x] Documentation updated ### Post-merge Actions After merging this PR, the following will happen automatically: 1. Tag will be created: `v1.0.3` 2. npm package will be published 3. GitHub release will be created with DXT artifacts 4. Changes will be back-merged to develop --- *This PR was automatically created by the release workflow.* --------- Co-authored-by: Abdallah Othman <abdallah.ali.hassan@gmail.com> Co-authored-by: smithery-ai[bot] <194235850+smithery-ai[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0c0e4ac commit 79bd0b7

37 files changed

Lines changed: 2206 additions & 620 deletions

CHANGELOG.md

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,95 @@
1-
## [1.0.2] - 2025-07-16
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.3] - 2025-08-11
29

310
### Added
4-
- New features go here
11+
- **MCP Initialization Config**: Dynamic configuration handling from MCP client info during initialization, enabling runtime flexibility (#12)
12+
- **Docker Deployment Support**: Added Dockerfile and Smithery configuration for cloud deployment (#6)
13+
- **Smithery Integration**: Users can now install and use the server via Smithery without local dependencies
514

615
### Changed
7-
- Changes go here
16+
- **Configuration Prioritization**: MCP init config now takes precedence over environment variables and other sources
17+
- Updated smithery.yaml configuration for improved deployment
818

919
### Fixed
10-
- Bug fixes go here
11-
20+
- Improved configuration loader with better precedence handling
21+
- Enhanced boolean parsing in configuration valuesUpdate
22+
- Fixed issues with Smithery MCP server Lokalise API Key token issue [#7](https://github.com/AbdallahAHO/lokalise-mcp/issues/7)
1223

13-
### Added
14-
- New features go here
24+
## [1.0.2] - 2025-01-17
1525

1626
### Changed
17-
- Changes go here
27+
- **Logger Optimization**: Deferred logger initialization and file setup for better performance
28+
- Improved logger lifecycle management to prevent early file system access
1829

1930
### Fixed
20-
- Bug fixes go here
31+
- Resolved logger initialization timing issues
32+
- Fixed potential race conditions in logger setup
2133

34+
## [1.0.1] - 2025-01-16
2235

23-
All notable changes to this project will be documented in this file.
36+
### Added
37+
- **Pre-commit Hooks**: Automated formatting and linting checks before commits
38+
- **Automated Release Workflow**: Streamlined release process with GitHub Actions
39+
- **CI Enhancements**: Extended CI workflow to run on all main branch pushes
2440

25-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
26-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
41+
### Changed
42+
- Updated DXT command configuration
43+
- Improved CI/CD pipeline with environment variable support for signing certificates
44+
- Enhanced release workflow permissions for GitHub Actions
45+
46+
### Fixed
47+
- GitHub CLI integration for PR creation to resolve permissions issues
48+
- Release workflow GitHub Actions permissions handling
49+
- Added missing CHANGELOG.md for automated releases
50+
- Removed redundant source file ignores from configuration
51+
52+
### Removed
53+
- Signature verification requirement from DXT command
2754

2855
## [1.0.0] - 2025-01-16
2956

3057
### Added
31-
- Initial release of Lokalise MCP Server
32-
- 39 MCP tools across 7 domains (Projects, Languages, Keys, Tasks, Comments, Translations, Contributors)
33-
- 16 MCP resources for data access
34-
- Auto-discovery domain architecture
35-
- HTTP and STDIO transport support
36-
- CLI mode for direct command execution
37-
- Domain scaffolding for easy extension
38-
- Comprehensive error handling and logging
39-
- Multi-source configuration management
58+
- **Initial Release** of Lokalise MCP Server
59+
- **39 MCP Tools** across 7 comprehensive domains:
60+
- **Projects** (6 tools): List, get, create, update, delete, and empty projects
61+
- **Languages** (6 tools): System languages, project languages management
62+
- **Keys** (7 tools): Complete key management with bulk operations
63+
- **Tasks** (5 tools): Translation task management
64+
- **Comments** (5 tools): Key and project comment handling
65+
- **Translations** (4 tools): Translation content management with cursor pagination
66+
- **Contributors** (6 tools): Team member and permission management
67+
- **16 MCP Resources** for efficient data access patterns
68+
- **Auto-Discovery Architecture**: Automatic domain registration without manual imports
69+
- **Dual Transport Support**: Both HTTP (default) and STDIO transports
70+
- **CLI Mode**: Direct command execution for scripting and automation
71+
- **Domain Scaffolding**: Interactive wizard for rapid domain generation
72+
- **Enterprise Features**:
73+
- Comprehensive error handling with custom McpError class
74+
- Contextualized logging with session tracking
75+
- Multi-source configuration management (ENV > .env > global config)
76+
- Zod schema validation for all inputs
77+
- Rate limiting and pagination support
78+
- **Developer Experience**:
79+
- TypeScript with strict mode
80+
- Biome for consistent formatting and linting
81+
- Jest testing framework with >80% coverage target
82+
- Comprehensive API documentation
83+
- .npmignore for clean package distribution
84+
85+
### Technical Details
86+
- Built with @modelcontextprotocol/sdk for MCP compliance
87+
- Official @lokalise/node-api client integration
88+
- Express server for HTTP transport with Server-Sent Events
89+
- Commander.js for CLI framework
90+
- ES modules with Node.js >=18.0.0 requirement
91+
92+
[1.0.3]: https://github.com/AbdallahAHO/lokalise-mcp/compare/v1.0.2...v1.0.3
93+
[1.0.2]: https://github.com/AbdallahAHO/lokalise-mcp/compare/v1.0.1...v1.0.2
94+
[1.0.1]: https://github.com/AbdallahAHO/lokalise-mcp/compare/v1.0.0...v1.0.1
95+
[1.0.0]: https://github.com/AbdallahAHO/lokalise-mcp/releases/tag/v1.0.0

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
2+
# syntax=docker/dockerfile:1
3+
FROM node:lts-alpine AS builder
4+
WORKDIR /app
5+
6+
# Copy necessary files first
7+
COPY package*.json tsconfig.json ./
8+
# Install dependencies without running postinstall scripts
9+
RUN npm install --ignore-scripts
10+
11+
# Copy entire repository
12+
COPY . .
13+
# Build the TypeScript source
14+
RUN npm run build
15+
16+
FROM node:lts-alpine AS runner
17+
WORKDIR /app
18+
19+
# Copy package manifests
20+
COPY --from=builder /app/package*.json ./
21+
# Install production dependencies without running postinstall
22+
RUN npm install --production --ignore-scripts
23+
24+
# Copy build artifacts
25+
COPY --from=builder /app/dist ./dist
26+
27+
# Default environment
28+
ENV TRANSPORT_MODE=http
29+
30+
EXPOSE 3000
31+
32+
CMD ["node", "dist/index.js"]

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
**Bring the power of Lokalise to your AI assistant**
99

10+
[![Smithery](https://smithery.cloud/status/@AbdallahAHO1/lokalise-mcp)](https://smithery.cloud/package/@AbdallahAHO1/lokalise-mcp)
1011
[![NPM Version](https://img.shields.io/npm/v/lokalise-mcp)](https://www.npmjs.com/package/lokalise-mcp)
1112
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
1213
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-blue)](https://www.typescriptlang.org/)
@@ -57,6 +58,14 @@ The Lokalise MCP Server connects AI assistants like Claude to [Lokalise](https:/
5758

5859
## 🚀 Quick Start
5960

61+
### Installing via Smithery
62+
63+
To install lokalise-mcp for Claude Desktop automatically via [Smithery](https://smithery.cloud/package/@AbdallahAHO1/lokalise-mcp):
64+
65+
```bash
66+
npx -y @smithery/cli install @AbdallahAHO1/lokalise-mcp --client claude
67+
```
68+
6069
### Prerequisites
6170
- Node.js 18 or higher
6271
- A Lokalise account with API access
@@ -252,4 +261,4 @@ MIT License - see [LICENSE](LICENSE) for details.
252261
<a href="https://github.com/AbdallahAHO/lokalise-mcp">⭐ Star us on GitHub</a> •
253262
<a href="https://github.com/AbdallahAHO/lokalise-mcp/issues">Report an Issue</a> •
254263
<a href="https://lokalise.com">Learn about Lokalise</a>
255-
</div>
264+
</div>

docs/CONFIGURATION.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Configuration Management
2+
3+
## Overview
4+
5+
The Lokalise MCP server uses a centralized configuration management system that provides:
6+
- **Single entry point** for all configuration access
7+
- **Strong typing** with TypeScript and Zod validation
8+
- **Priority-based** configuration loading from multiple sources
9+
- **Environment-specific** configuration support
10+
11+
## Configuration Priority
12+
13+
Configuration values are loaded from multiple sources with the following priority (highest to lowest):
14+
15+
1. **HTTP Query Parameters** (Smithery) - Passed via query strings
16+
2. **MCP Initialization Config** - From clientInfo during MCP initialization
17+
3. **Environment Variables** - Direct process.env values
18+
4. **`.env` File** - Project root .env file
19+
5. **Global Config File** - `~/.mcp/configs.json`
20+
21+
Higher priority sources override lower priority ones.
22+
23+
## Usage
24+
25+
### Import the Config Utility
26+
27+
```typescript
28+
import { config } from "./shared/utils/config.util.js";
29+
```
30+
31+
### Load Configuration
32+
33+
Configuration is automatically loaded when first accessed, but can be explicitly loaded:
34+
35+
```typescript
36+
config.load(); // Called automatically in main entry point
37+
```
38+
39+
### Access Configuration Values
40+
41+
All configuration access should go through typed getter methods:
42+
43+
```typescript
44+
// Core configuration
45+
const apiKey = config.getLokaliseApiKey(); // Required, throws if not set
46+
const apiHost = config.getLokaliseApiHostname(); // With default fallback
47+
48+
// Server configuration
49+
const transportMode = config.getTransportMode(); // "stdio" | "http"
50+
const port = config.getPort(); // Default: 3000
51+
52+
// Debug configuration
53+
const isDebug = config.isDebugEnabled(); // boolean
54+
const debugPattern = config.getDebugPattern(); // string | undefined
55+
56+
// Environment detection
57+
const isTest = config.isTestEnvironment(); // Detects test environment
58+
const isMcpServer = config.isMcpServerMode(); // MCP server vs CLI mode
59+
const nodeEnv = config.getNodeEnv(); // "development" | "test" | "production"
60+
```
61+
62+
### Set Configuration from Different Sources
63+
64+
```typescript
65+
// Set HTTP query configuration (highest priority)
66+
config.setHttpQueryConfig({
67+
LOKALISE_API_KEY: "key_from_query",
68+
debug_mode: true
69+
});
70+
71+
// Set MCP initialization configuration
72+
config.setMcpInitConfig({
73+
LOKALISE_API_KEY: "key_from_mcp",
74+
DEBUG: false
75+
});
76+
```
77+
78+
### Validate Configuration
79+
80+
```typescript
81+
const validation = config.validate();
82+
if (!validation.valid) {
83+
console.error("Configuration errors:", validation.errors);
84+
}
85+
```
86+
87+
## Environment Variables
88+
89+
The following environment variables are supported:
90+
91+
| Variable | Type | Required | Default | Description |
92+
|----------|------|----------|---------|-------------|
93+
| `LOKALISE_API_KEY` | string | Yes | - | Your Lokalise API token |
94+
| `LOKALISE_API_HOSTNAME` | string | No | `https://api.lokalise.com/api2/` | Custom Lokalise API endpoint |
95+
| `TRANSPORT_MODE` | string | No | `stdio` | Transport mode: `stdio` or `http` |
96+
| `PORT` | number | No | `3000` | HTTP server port (only for HTTP transport) |
97+
| `DEBUG` | boolean/string | No | `false` | Debug mode or pattern for selective logging |
98+
| `NODE_ENV` | string | No | - | Node environment: `development`, `test`, `production` |
99+
| `MCP_SERVER_MODE` | boolean | No | `false` | Indicates if running as MCP server |
100+
101+
## Configuration Files
102+
103+
### `.env` File
104+
105+
Create a `.env` file in the project root:
106+
107+
```env
108+
LOKALISE_API_KEY=your_api_key_here
109+
LOKALISE_API_HOSTNAME=https://api.lokalise.com/api2/
110+
TRANSPORT_MODE=http
111+
PORT=3000
112+
DEBUG=true
113+
```
114+
115+
### Global Config File
116+
117+
Create `~/.mcp/configs.json` for global configuration:
118+
119+
```json
120+
{
121+
"lokalise-mcp": {
122+
"environments": {
123+
"LOKALISE_API_KEY": "your_global_api_key",
124+
"LOKALISE_API_HOSTNAME": "https://api.lokalise.com/api2/"
125+
}
126+
}
127+
}
128+
```
129+
130+
## Debug Configuration
131+
132+
The `DEBUG` environment variable supports multiple formats:
133+
134+
- `true` or `1` - Enable all debug logging
135+
- `false` or `0` - Disable debug logging
136+
- Pattern string - Enable selective logging (e.g., `"controllers/*,services/*"`)
137+
138+
Examples:
139+
```bash
140+
DEBUG=true # Enable all debug
141+
DEBUG=controllers/* # Debug only controllers
142+
DEBUG=services/*,utils/* # Debug services and utils
143+
```
144+
145+
## Type Safety
146+
147+
All configuration is strongly typed using Zod schemas:
148+
149+
```typescript
150+
// Configuration schema is defined in src/shared/schemas/config.schema.ts
151+
export const RuntimeConfigSchema = z.object({
152+
LOKALISE_API_KEY: z.string().min(1, "LOKALISE_API_KEY is required"),
153+
LOKALISE_API_HOSTNAME: z.string().url().default("https://api.lokalise.com/api2/"),
154+
TRANSPORT_MODE: z.enum(["stdio", "http"]).default("stdio"),
155+
PORT: z.number().int().min(1).max(65535).default(3000),
156+
DEBUG: z.union([z.boolean(), z.string()]).default(false),
157+
// ... other fields
158+
});
159+
```
160+
161+
## Best Practices
162+
163+
1. **Never access `process.env` directly** - Always use the config utility
164+
2. **Use typed getter methods** - Avoid generic `config.get()` when possible
165+
3. **Handle configuration errors early** - Validate configuration at startup
166+
4. **Use appropriate defaults** - Provide sensible defaults for optional values
167+
5. **Document required variables** - Clearly indicate which variables are required
168+
169+
## Migration Guide
170+
171+
If you're updating code that previously used `process.env` directly:
172+
173+
```typescript
174+
// ❌ Old way - direct process.env access
175+
const apiKey = process.env.LOKALISE_API_KEY;
176+
const isTest = process.env.NODE_ENV === "test";
177+
178+
// ✅ New way - through config utility
179+
import { config } from "./shared/utils/config.util.js";
180+
const apiKey = config.getLokaliseApiKey();
181+
const isTest = config.isTestEnvironment();
182+
```
183+
184+
## Exceptions
185+
186+
The following cases legitimately use `process.env` directly:
187+
188+
1. **Logger utility** - To avoid circular dependencies
189+
2. **Test utilities** - When spawning child processes or manipulating test environment
190+
3. **Build scripts** - Scripts that run outside the main application context
191+
192+
## Smithery Integration
193+
194+
For Smithery deployments, configuration can be passed via HTTP query parameters:
195+
196+
```
197+
GET /mcp?LOKALISE_API_KEY=key&debug_mode=true
198+
```
199+
200+
These query parameters have the highest priority and will override all other configuration sources.

0 commit comments

Comments
 (0)