@ecubelabs/atlassian-mcp 1.14.0-next.1 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,18 @@
1
-
2
1
  ## Local Test
3
2
 
4
3
  ### 1. mcp 설정 생성
4
+
5
5
  프로젝트 루트에 .mcp.local.json 을 생성하고 아래와 같이 내용을 채워넣는다:
6
+
6
7
  ```json
7
8
  {
8
- "mcpServers": {
9
- "atlassian-jira": {
10
- "type": "stdio",
11
- "command": "node",
12
- "args": ["./packages/atlassian-mcp/dist/index.js"]
9
+ "mcpServers": {
10
+ "atlassian-jira": {
11
+ "type": "stdio",
12
+ "command": "node",
13
+ "args": ["./packages/atlassian-mcp/dist/index.js"]
14
+ }
13
15
  }
14
- }
15
16
  }
16
17
  ```
17
18
 
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
4
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
5
  import { registerJiraTools } from './jira-tools-register.js';
6
6
  import { registerConfluenceTools } from './confluence-tools-register.js';
7
- import { cleanupOldTempFiles } from './libs/response-formatter.js';
7
+ import { cleanupOldTempFiles, validateTempDir } from './libs/response-formatter.js';
8
8
  // Create server instance
9
9
  const server = new McpServer({
10
10
  name: 'atlassian',
@@ -14,6 +14,7 @@ registerJiraTools(server);
14
14
  registerConfluenceTools(server);
15
15
  // Start the server
16
16
  async function main() {
17
+ validateTempDir();
17
18
  cleanupOldTempFiles();
18
19
  const transport = new StdioServerTransport();
19
20
  await server.connect(transport);
@@ -381,7 +381,7 @@ export class ConfluenceService extends BaseApiService {
381
381
  if (options?.expand) {
382
382
  params.expand = options.expand.join(',');
383
383
  }
384
- return this.makeRequest(() => this.v1Client.get(`/template/page/${contentTemplateId}`, { params }));
384
+ return this.makeRequest(() => this.v1Client.get(`/template/${contentTemplateId}`, { params }));
385
385
  }
386
386
  /**
387
387
  * 페이지를 다른 위치로 이동
@@ -1,18 +1,50 @@
1
- import { writeFileSync, readdirSync, statSync, unlinkSync } from 'node:fs';
1
+ import { writeFileSync, readdirSync, statSync, unlinkSync, accessSync, constants } from 'node:fs';
2
2
  import { tmpdir } from 'node:os';
3
3
  import { join } from 'node:path';
4
4
  import { randomUUID } from 'node:crypto';
5
5
  const DEFAULT_THRESHOLD = 20_000;
6
6
  const MAX_AGE_MS = 60 * 60 * 1000; // 1 hour
7
+ function getTempDir() {
8
+ return process.env.ATLASSIAN_MCP_TEMP_DIR || tmpdir();
9
+ }
10
+ export function validateTempDir() {
11
+ const customDir = process.env.ATLASSIAN_MCP_TEMP_DIR;
12
+ if (!customDir)
13
+ return;
14
+ try {
15
+ accessSync(customDir, constants.W_OK);
16
+ }
17
+ catch {
18
+ console.error(`[atlassian-mcp] Warning: ATLASSIAN_MCP_TEMP_DIR="${customDir}" is not accessible or writable. ` +
19
+ `Temp file writes may fail. Ensure the directory exists and has write permissions.`);
20
+ }
21
+ }
7
22
  export function formatToolResponse(data, options) {
8
23
  const text = typeof data === 'string' ? data : JSON.stringify(data);
9
24
  const threshold = options.threshold ?? DEFAULT_THRESHOLD;
10
25
  if (text.length <= threshold) {
11
26
  return { content: [{ type: 'text', text }] };
12
27
  }
28
+ const tempDir = getTempDir();
13
29
  const fileName = `atlassian-mcp-${options.toolName}-${Date.now()}-${randomUUID().slice(0, 8)}.json`;
14
- const filePath = join(tmpdir(), fileName);
15
- writeFileSync(filePath, text, 'utf-8');
30
+ const filePath = join(tempDir, fileName);
31
+ try {
32
+ writeFileSync(filePath, text, 'utf-8');
33
+ }
34
+ catch (error) {
35
+ const errMsg = error instanceof Error ? error.message : String(error);
36
+ const message = [
37
+ `Response too large (${text.length.toLocaleString()} chars) but failed to save temp file.`,
38
+ ``,
39
+ `Error: ${errMsg}`,
40
+ `Directory: ${tempDir}`,
41
+ ``,
42
+ `To fix this, use the Bash tool to run:`,
43
+ ` mkdir -p "${tempDir}" && chmod 755 "${tempDir}"`,
44
+ `Then retry the original request.`,
45
+ ].join('\n');
46
+ return { content: [{ type: 'text', text: message }] };
47
+ }
16
48
  const message = [
17
49
  `Response too large (${text.length.toLocaleString()} chars). Full data saved to temporary file.`,
18
50
  ``,
@@ -27,7 +59,7 @@ export function formatToolResponse(data, options) {
27
59
  }
28
60
  export function cleanupOldTempFiles() {
29
61
  try {
30
- const dir = tmpdir();
62
+ const dir = getTempDir();
31
63
  const files = readdirSync(dir).filter((f) => f.startsWith('atlassian-mcp-') && f.endsWith('.json'));
32
64
  const now = Date.now();
33
65
  for (const file of files) {
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@ecubelabs/atlassian-mcp",
3
- "version": "1.14.0-next.1",
3
+ "version": "1.14.1",
4
4
  "bin": "./dist/index.js",
5
5
  "repository": {
6
6
  "url": "https://github.com/Ecube-Labs/skynet.git"
7
7
  },
8
8
  "scripts": {
9
- "lint": "eslint \"./src/**/*.ts\"",
9
+ "lint": "oxfmt --check . && oxlint && eslint \"src/**/*.ts\"",
10
+ "lint:ci": "oxfmt --check . && oxlint --quiet && eslint --quiet \"src/**/*.ts\"",
11
+ "lint:fix": "oxfmt . && oxlint --fix --quiet && eslint --fix \"src/**/*.ts\"",
10
12
  "build": "tsc && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
11
13
  "prepack": "yarn build"
12
14
  },
@@ -20,7 +22,7 @@
20
22
  "type": "module",
21
23
  "dependencies": {
22
24
  "@modelcontextprotocol/sdk": "^1.26.0",
23
- "axios": "^1.13.5",
25
+ "axios": "^1.15.2",
24
26
  "axios-retry": "^4.5.0",
25
27
  "dotenv": "^17.2.0",
26
28
  "marklassian": "^1.1.0",
@@ -30,13 +32,11 @@
30
32
  },
31
33
  "devDependencies": {
32
34
  "@types/node": "^20.14.8",
33
- "eslint": "^8.57.0",
35
+ "eslint": "^9.27.0",
34
36
  "eslint-config-skynet": "^0.0.0",
35
- "prettier": "^3.5.1",
36
37
  "semantic-release": "^24.2.7",
37
38
  "semantic-release-yarn": "^3.0.2",
38
39
  "ts-node": "^10.9.2",
39
40
  "typescript": "^5.8.2"
40
- },
41
- "stableVersion": "1.0.0"
41
+ }
42
42
  }