@ama-work/mcp-atlassian 1.0.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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -0
  3. package/dist/client/adf.d.ts +17 -0
  4. package/dist/client/adf.js +137 -0
  5. package/dist/client/atlassian.d.ts +20908 -0
  6. package/dist/client/atlassian.js +28 -0
  7. package/dist/config.d.ts +2 -0
  8. package/dist/config.js +59 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +11 -0
  11. package/dist/tools/confluence-comment.d.ts +2 -0
  12. package/dist/tools/confluence-comment.js +19 -0
  13. package/dist/tools/confluence-create.d.ts +2 -0
  14. package/dist/tools/confluence-create.js +26 -0
  15. package/dist/tools/confluence-get.d.ts +2 -0
  16. package/dist/tools/confluence-get.js +33 -0
  17. package/dist/tools/confluence-search.d.ts +2 -0
  18. package/dist/tools/confluence-search.js +14 -0
  19. package/dist/tools/confluence-spaces.d.ts +2 -0
  20. package/dist/tools/confluence-spaces.js +17 -0
  21. package/dist/tools/confluence-update.d.ts +2 -0
  22. package/dist/tools/confluence-update.js +25 -0
  23. package/dist/tools/confluence.d.ts +2 -0
  24. package/dist/tools/confluence.js +14 -0
  25. package/dist/tools/jira-comment.d.ts +2 -0
  26. package/dist/tools/jira-comment.js +20 -0
  27. package/dist/tools/jira-create.d.ts +2 -0
  28. package/dist/tools/jira-create.js +39 -0
  29. package/dist/tools/jira-get.d.ts +2 -0
  30. package/dist/tools/jira-get.js +20 -0
  31. package/dist/tools/jira-projects.d.ts +2 -0
  32. package/dist/tools/jira-projects.js +23 -0
  33. package/dist/tools/jira-search.d.ts +2 -0
  34. package/dist/tools/jira-search.js +37 -0
  35. package/dist/tools/jira-transition.d.ts +2 -0
  36. package/dist/tools/jira-transition.js +30 -0
  37. package/dist/tools/jira-update.d.ts +2 -0
  38. package/dist/tools/jira-update.js +39 -0
  39. package/dist/tools/jira.d.ts +2 -0
  40. package/dist/tools/jira.js +16 -0
  41. package/dist/tools/meta.d.ts +2 -0
  42. package/dist/tools/meta.js +18 -0
  43. package/dist/types.d.ts +14 -0
  44. package/dist/types.js +1 -0
  45. package/package.json +52 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ask-Me-Anything-dot-work
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,110 @@
1
+ # ama-mcp-atlassian
2
+
3
+ Standalone TypeScript MCP server wrapping the Atlassian REST API (Jira + Confluence). Works standalone via env vars or registry-integrated via [ama-mcp-registry](https://github.com/Ask-Me-Anything-dot-work/ama-mcp-registry).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @ama-work/mcp-atlassian
9
+ # or
10
+ bunx @ama-work/mcp-atlassian
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Claude Desktop
16
+
17
+ Add to your `claude_desktop_config.json`:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "atlassian": {
23
+ "command": "bunx",
24
+ "args": ["@ama-work/mcp-atlassian"],
25
+ "env": {
26
+ "ATLASSIAN_ACCESS_TOKEN": "your-oauth-access-token",
27
+ "ATLASSIAN_CLOUD_ID": "your-atlassian-cloud-id"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### Standalone mode
35
+
36
+ Provide an Atlassian OAuth access token and your cloud ID directly:
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "atlassian": {
42
+ "command": "bunx",
43
+ "args": ["@ama-work/mcp-atlassian"],
44
+ "env": {
45
+ "ATLASSIAN_ACCESS_TOKEN": "your-oauth-access-token",
46
+ "ATLASSIAN_CLOUD_ID": "your-atlassian-cloud-id"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Registry-integrated mode
54
+
55
+ If you run [ama-mcp-registry](https://github.com/Ask-Me-Anything-dot-work/ama-mcp-registry), the server fetches its token automatically:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "atlassian": {
61
+ "command": "bunx",
62
+ "args": ["@ama-work/mcp-atlassian"],
63
+ "env": {
64
+ "REGISTRY_URL": "https://your-registry.example.com",
65
+ "INSTANCE_ID": "your-instance-id",
66
+ "GATEWAY_PSK": "your-pre-shared-key"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ The token is cached and proactively refreshed 5 minutes before expiry.
74
+
75
+ ## MCP Registry Integration
76
+
77
+ Import the canonical definition via URL:
78
+
79
+ ```
80
+ https://raw.githubusercontent.com/Ask-Me-Anything-dot-work/ama-mcp-atlassian/main/definitions/atlassian.json
81
+ ```
82
+
83
+ ### OAuth Setup
84
+
85
+ Before using this server, register an OAuth 2.0 app at [developer.atlassian.com](https://developer.atlassian.com):
86
+
87
+ 1. Create a new OAuth 2.0 app
88
+ 2. Add the required scopes (see `definitions/atlassian.json`)
89
+ 3. Copy the **Client ID** and replace `YOUR_ATLASSIAN_CLIENT_ID` in the definition
90
+ 4. Generate an access token with the required scopes
91
+
92
+ ## Tools
93
+
94
+ **Jira:** `jira_search_issues`, `jira_get_issue`, `jira_create_issue`, `jira_update_issue`, `jira_transition_issue`, `jira_add_comment`, `jira_get_projects`
95
+
96
+ **Confluence:** `confluence_search`, `confluence_get_page`, `confluence_create_page`, `confluence_update_page`, `confluence_add_comment`, `confluence_get_spaces`
97
+
98
+ **Meta:** `atlassian_whoami`
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ bash bootstrap.sh
104
+ bun run typecheck
105
+ bun run lint
106
+ ```
107
+
108
+ ## License
109
+
110
+ MIT
@@ -0,0 +1,17 @@
1
+ interface AdfNode {
2
+ type: string;
3
+ content?: AdfNode[];
4
+ text?: string;
5
+ marks?: Array<{
6
+ type: string;
7
+ }>;
8
+ attrs?: Record<string, unknown>;
9
+ }
10
+ interface AdfDoc {
11
+ version: number;
12
+ type: "doc";
13
+ content: AdfNode[];
14
+ }
15
+ export declare function toADF(markdown: string): AdfDoc;
16
+ export declare function fromADF(doc: AdfDoc | AdfNode): string;
17
+ export {};
@@ -0,0 +1,137 @@
1
+ function parseInline(text) {
2
+ const nodes = [];
3
+ const pattern = /(\*\*\*(.+?)\*\*\*|\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`)/g;
4
+ let last = 0;
5
+ let m;
6
+ while ((m = pattern.exec(text)) !== null) {
7
+ if (m.index > last) {
8
+ nodes.push({ type: "text", text: text.slice(last, m.index) });
9
+ }
10
+ nodes.push(parseInlineMatch(m));
11
+ last = m.index + m[0].length;
12
+ }
13
+ if (last < text.length) {
14
+ nodes.push({ type: "text", text: text.slice(last) });
15
+ }
16
+ return nodes.length ? nodes : [{ type: "text", text }];
17
+ }
18
+ function parseInlineMatch(m) {
19
+ if (m[2])
20
+ return { type: "text", text: m[2], marks: [{ type: "strong" }, { type: "em" }] };
21
+ if (m[3])
22
+ return { type: "text", text: m[3], marks: [{ type: "strong" }] };
23
+ if (m[4])
24
+ return { type: "text", text: m[4], marks: [{ type: "em" }] };
25
+ return { type: "text", text: m[5], marks: [{ type: "code" }] };
26
+ }
27
+ function parseCodeBlock(lines, start) {
28
+ const lang = lines[start].slice(3).trim();
29
+ const codeLines = [];
30
+ let i = start + 1;
31
+ while (i < lines.length && !lines[i].startsWith("```")) {
32
+ codeLines.push(lines[i]);
33
+ i++;
34
+ }
35
+ const node = { type: "codeBlock", content: [{ type: "text", text: codeLines.join("\n") }] };
36
+ if (lang)
37
+ node.attrs = { language: lang };
38
+ return { node, next: i + 1 };
39
+ }
40
+ function parseBulletList(lines, start) {
41
+ const items = [];
42
+ let i = start;
43
+ while (i < lines.length && lines[i].match(/^[-*]\s+/)) {
44
+ const itemText = lines[i].replace(/^[-*]\s+/, "");
45
+ items.push({ type: "listItem", content: [{ type: "paragraph", content: parseInline(itemText) }] });
46
+ i++;
47
+ }
48
+ return { node: { type: "bulletList", content: items }, next: i };
49
+ }
50
+ export function toADF(markdown) {
51
+ const lines = markdown.split("\n");
52
+ const content = [];
53
+ let i = 0;
54
+ while (i < lines.length) {
55
+ const line = lines[i];
56
+ if (line.startsWith("```")) {
57
+ const result = parseCodeBlock(lines, i);
58
+ content.push(result.node);
59
+ i = result.next;
60
+ continue;
61
+ }
62
+ const headingMatch = line.match(/^(#{1,6})\s+(.+)/);
63
+ if (headingMatch) {
64
+ content.push({
65
+ type: "heading",
66
+ attrs: { level: headingMatch[1].length },
67
+ content: parseInline(headingMatch[2]),
68
+ });
69
+ i++;
70
+ continue;
71
+ }
72
+ if (line.match(/^[-*]\s+/)) {
73
+ const result = parseBulletList(lines, i);
74
+ content.push(result.node);
75
+ i = result.next;
76
+ continue;
77
+ }
78
+ if (line.trim() !== "") {
79
+ content.push({ type: "paragraph", content: parseInline(line) });
80
+ }
81
+ i++;
82
+ }
83
+ return { version: 1, type: "doc", content };
84
+ }
85
+ function renderMarks(text, marks) {
86
+ if (!marks?.length)
87
+ return text;
88
+ let result = text;
89
+ for (const mark of marks) {
90
+ if (mark.type === "strong")
91
+ result = `**${result}**`;
92
+ else if (mark.type === "em")
93
+ result = `*${result}*`;
94
+ else if (mark.type === "code")
95
+ result = `\`${result}\``;
96
+ }
97
+ return result;
98
+ }
99
+ function renderTextNode(node) {
100
+ return renderMarks(node.text ?? "", node.marks);
101
+ }
102
+ function renderCodeBlock(node) {
103
+ const lang = node.attrs?.language ?? "";
104
+ const code = (node.content ?? []).map(renderNode).join("");
105
+ return `\`\`\`${lang}\n${code}\n\`\`\`\n`;
106
+ }
107
+ function renderHeading(node) {
108
+ const level = node.attrs?.level ?? 1;
109
+ return `${"#".repeat(level)} ${(node.content ?? []).map(renderNode).join("")}\n`;
110
+ }
111
+ function renderListItem(node) {
112
+ return (node.content ?? []).map(renderNode).join("");
113
+ }
114
+ function renderNode(node) {
115
+ switch (node.type) {
116
+ case "text":
117
+ return renderTextNode(node);
118
+ case "paragraph":
119
+ return (node.content ?? []).map(renderNode).join("") + "\n";
120
+ case "heading":
121
+ return renderHeading(node);
122
+ case "bulletList":
123
+ return (node.content ?? []).map((item) => `- ${renderNode(item)}`).join("");
124
+ case "listItem":
125
+ return renderListItem(node);
126
+ case "codeBlock":
127
+ return renderCodeBlock(node);
128
+ default:
129
+ return (node.content ?? []).map(renderNode).join("");
130
+ }
131
+ }
132
+ export function fromADF(doc) {
133
+ if (doc.type === "doc") {
134
+ return (doc.content ?? []).map(renderNode).join("");
135
+ }
136
+ return renderNode(doc);
137
+ }