@verygoodplugins/mcp-freescout 1.4.2 → 2.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.
@@ -0,0 +1,26 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ groups:
8
+ production-dependencies:
9
+ patterns:
10
+ - "*"
11
+ exclude-patterns:
12
+ - "@types/*"
13
+ - "typescript"
14
+ - "vitest"
15
+ - "eslint*"
16
+ - "prettier"
17
+ dev-dependencies:
18
+ patterns:
19
+ - "@types/*"
20
+ - "typescript"
21
+ - "vitest"
22
+ - "eslint*"
23
+ - "prettier"
24
+ commit-message:
25
+ prefix: "chore(deps)"
26
+ open-pull-requests-limit: 10
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ push:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: "20"
18
+ cache: "npm"
19
+
20
+ - name: Install dependencies
21
+ run: npm ci
22
+
23
+ - name: Lint
24
+ run: npm run lint
25
+
26
+ - name: Build
27
+ run: npm run build
28
+
29
+ - name: Unit tests
30
+ run: npm test
31
+
32
+ - name: Integration tests
33
+ env:
34
+ FREESCOUT_URL: ${{ secrets.FREESCOUT_URL }}
35
+ FREESCOUT_API_KEY: ${{ secrets.FREESCOUT_API_KEY }}
36
+ run: npm run test:integration
37
+
38
+ - name: Test coverage
39
+ run: npm run test:coverage
40
+ continue-on-error: true
@@ -0,0 +1,105 @@
1
+ # Release Please - Automated versioning and npm publishing
2
+ #
3
+ # How it works:
4
+ # 1. Every push to main with conventional commits updates a "Release PR"
5
+ # 2. When you merge the Release PR, it:
6
+ # - Updates version in package.json
7
+ # - Updates CHANGELOG.md
8
+ # - Creates a GitHub Release with tag
9
+ # - Triggers the npm publish job below
10
+ #
11
+ # Commit message format:
12
+ # feat: add new feature → minor version bump
13
+ # fix: fix a bug → patch version bump
14
+ # feat!: breaking change → major version bump
15
+ # chore/docs: no version bump
16
+ #
17
+ # npm Publishing:
18
+ # Uses Trusted Publishing (OIDC) - no secrets needed!
19
+ # Configure at: https://www.npmjs.com/package/@verygoodplugins/mcp-{name}/access
20
+
21
+ name: Release Please
22
+
23
+ on:
24
+ push:
25
+ branches:
26
+ - main
27
+
28
+ permissions:
29
+ contents: write
30
+ pull-requests: write
31
+
32
+ jobs:
33
+ release-please:
34
+ runs-on: ubuntu-latest
35
+ outputs:
36
+ release_created: ${{ steps.release.outputs.release_created }}
37
+ tag_name: ${{ steps.release.outputs.tag_name }}
38
+ steps:
39
+ - uses: googleapis/release-please-action@v4
40
+ id: release
41
+ with:
42
+ release-type: node
43
+
44
+ npm-publish:
45
+ needs: release-please
46
+ if: ${{ needs.release-please.outputs.release_created }}
47
+ runs-on: ubuntu-latest
48
+ permissions:
49
+ contents: read
50
+ id-token: write
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+
54
+ - uses: actions/setup-node@v4
55
+ with:
56
+ node-version: "20"
57
+
58
+ - run: npm ci
59
+ - run: npm run build
60
+ - run: npm test
61
+
62
+ # Trusted Publishing via OIDC - no NPM_TOKEN needed
63
+ - run: |
64
+ echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc
65
+ npm publish --access public --provenance
66
+ env:
67
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68
+
69
+ mcp-registry-publish:
70
+ needs: [release-please, npm-publish]
71
+ if: ${{ needs.release-please.outputs.release_created }}
72
+ runs-on: ubuntu-latest
73
+ permissions:
74
+ contents: read
75
+ id-token: write
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+
79
+ - name: Install mcp-publisher CLI
80
+ run: |
81
+ curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
82
+ sudo mv mcp-publisher /usr/local/bin/
83
+
84
+ - name: Publish to MCP Registry
85
+ run: |
86
+ mcp-publisher login github-oidc
87
+ mcp-publisher publish
88
+ env:
89
+ MCP_REGISTRY_URL: https://registry.modelcontextprotocol.io
90
+
91
+ announce:
92
+ needs: [release-please, npm-publish]
93
+ if: ${{ needs.release-please.outputs.release_created }}
94
+ runs-on: ubuntu-latest
95
+ steps:
96
+ - name: Post to Slack
97
+ if: ${{ vars.SLACK_WEBHOOK_URL }}
98
+ uses: slackapi/slack-github-action@v1
99
+ with:
100
+ webhook-url: ${{ vars.SLACK_WEBHOOK_URL }}
101
+ webhook-type: incoming-webhook
102
+ payload: |
103
+ {
104
+ "text": "🚀 ${{ github.repository }} ${{ needs.release-please.outputs.tag_name }} released!\n\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.release-please.outputs.tag_name }}"
105
+ }
@@ -0,0 +1,53 @@
1
+ name: Security
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * 0" # Weekly on Sunday
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
+ branches: [main]
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ security-events: write
15
+
16
+ jobs:
17
+ codeql:
18
+ name: CodeQL Analysis
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Initialize CodeQL
24
+ uses: github/codeql-action/init@v4
25
+ with:
26
+ languages: typescript
27
+
28
+ - name: Autobuild
29
+ uses: github/codeql-action/autobuild@v4
30
+
31
+ - name: Perform CodeQL Analysis
32
+ uses: github/codeql-action/analyze@v4
33
+
34
+ audit:
35
+ name: Dependency Audit
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - uses: actions/setup-node@v4
41
+ with:
42
+ node-version: "20"
43
+ cache: "npm"
44
+
45
+ - run: npm ci
46
+
47
+ - name: Audit dependencies
48
+ run: npm audit --audit-level=high
49
+ continue-on-error: true
50
+
51
+ - name: Check for known vulnerabilities
52
+ run: npx better-npm-audit audit --level high
53
+ continue-on-error: true
@@ -0,0 +1 @@
1
+ ghu_WCit0EAr4fdNAjRrj9nbXwx6JHNk924SFHSI
@@ -0,0 +1 @@
1
+ {"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3Njc1ODIwMDgsIm5iZiI6MTc2NzU4MTcwOCwiaWF0IjoxNzY3NTgxNzA4LCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6ImphY2stYXJ0dXJvIiwicGVybWlzc2lvbnMiOlt7ImFjdGlvbiI6InB1Ymxpc2giLCJyZXNvdXJjZSI6ImlvLmdpdGh1Yi5qYWNrLWFydHVyby8qIn0seyJhY3Rpb24iOiJwdWJsaXNoIiwicmVzb3VyY2UiOiJpby5naXRodWIuRWNob0Rhc2gvKiJ9LHsiYWN0aW9uIjoicHVibGlzaCIsInJlc291cmNlIjoiaW8uZ2l0aHViLnZlcnlnb29kcGx1Z2lucy8qIn1dfQ.xnQXSuBQcR6DyNqFVOz4DwNbUblw5h-7pUM_g5WtkstRZHJGqyT5NOWnZHFYprRrbXTB3swPzklQDosBFn_oCw","expires_at":1767582008}
@@ -0,0 +1,24 @@
1
+ # Build outputs
2
+ dist/
3
+ build/
4
+ *.js.map
5
+ *.d.ts.map
6
+
7
+ # Dependencies
8
+ node_modules/
9
+
10
+ # Lock files
11
+ package-lock.json
12
+ yarn.lock
13
+
14
+ # Git
15
+ .git/
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+
21
+ # Temporary files
22
+ *.log
23
+ .DS_Store
24
+
package/.prettierrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "es5",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "arrowParens": "avoid",
9
+ "proseWrap": "preserve"
10
+ }
package/AGENTS.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # Repository Guidelines
2
2
 
3
3
  ## Project Structure & Modules
4
+
4
5
  - **Source**: TypeScript sources live in `src/` (`index.ts`, `freescout-api.ts`, `ticket-analyzer.ts`, `types.ts`).
5
6
  - **Build output**: Compiled JavaScript and type declarations are in `dist/` (do not edit directly).
6
7
  - **Entry point**: The MCP server CLI entry is `src/index.ts`, built to `dist/index.js` and exposed as `mcp-freescout`.
7
8
 
8
9
  ## Build, Test & Development
10
+
9
11
  - **Install**: `npm install` – install dependencies.
10
12
  - **Dev server**: `npm run dev` – run `src/index.ts` with live reload.
11
13
  - **Build**: `npm run build` – compile TypeScript to `dist/`.
@@ -14,23 +16,27 @@
14
16
  - **Format**: `npm run format` – apply Prettier formatting to `src/**/*.ts`.
15
17
 
16
18
  ## Coding Style & Naming
19
+
17
20
  - **Language**: TypeScript with ES modules (`type: module`).
18
21
  - **Formatting**: Use Prettier via `npm run format`; 2‑space indentation and single quotes where possible.
19
22
  - **Linting**: ESLint with `@typescript-eslint` rules; fix warnings before opening a PR.
20
23
  - **Naming**: Use `camelCase` for variables/functions, `PascalCase` for classes/types, and descriptive file names (e.g., `freescout-api.ts`).
21
24
 
22
25
  ## Testing Guidelines
26
+
23
27
  - **Framework**: Jest (`npm test`).
24
28
  - **Location**: Place tests alongside code as `*.test.ts` or in a dedicated test folder if introduced consistently.
25
29
  - **Scope**: Cover new behavior, especially FreeScout API calls and ticket analysis logic.
26
30
  - **CI readiness**: Ensure `npm test` and `npm run lint` pass locally before pushing.
27
31
 
28
32
  ## Commit & Pull Requests
33
+
29
34
  - **Commits**: Write clear, imperative messages (e.g., `Add ticket analyzer tests`, `Fix FreeScout auth error`).
30
35
  - **Branches**: Use short, descriptive names (e.g., `feat/ticket-tags`, `fix/rate-limits`).
31
36
  - **PRs**: Include a concise summary, motivation, testing notes (`npm test`, `npm run lint`), and link related issues. Add screenshots or logs when changing error handling or CLI behavior.
32
37
 
33
38
  ## Memory MCP Usage
39
+
34
40
  - **Start of work**: Use the memory MCP to recall project-specific context for the area you are modifying (recent bugs, decisions, or related files).
35
41
  - **During/after work**: When you fix an issue or learn something important (API behavior, edge case, configuration nuance), store or update a memory via the MCP.
36
42
  - **Associations**: When relevant, associate new memories with existing ones (e.g., linking a bugfix to a specific module or decision) to keep context navigable for future tasks.
package/CHANGELOG.md ADDED
@@ -0,0 +1,157 @@
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
+ ## [2.0.1](https://github.com/verygoodplugins/mcp-freescout/compare/v2.0.0...v2.0.1) (2026-01-06)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Add env loader and improve schema flexibility ([29e8837](https://github.com/verygoodplugins/mcp-freescout/commit/29e8837714433e3b60b878b9e7a7a106a751f44d))
14
+ * Add env loader and improve schema flexibility ([31bc42d](https://github.com/verygoodplugins/mcp-freescout/commit/31bc42dbf9fe37003cea5c82e4a054b69b84ff14))
15
+ * remove outputSchema from freescout_get_ticket to fix validation errors ([#17](https://github.com/verygoodplugins/mcp-freescout/issues/17)) ([571b987](https://github.com/verygoodplugins/mcp-freescout/commit/571b987899dfb2816ff3eeaffc2ac0d852224433))
16
+ * validation errors + feat: includeLastMessage for search ([#18](https://github.com/verygoodplugins/mcp-freescout/issues/18)) ([dd884fa](https://github.com/verygoodplugins/mcp-freescout/commit/dd884fadf9d5ad24f28037e3eeff9613dfbccd4e))
17
+
18
+ ## [2.0.0] - 2026-01-05
19
+
20
+ ### Breaking Changes
21
+
22
+ - **Search API redesign**: Replaced fragile query-string syntax (`assignee:null`) with explicit filter parameters
23
+ - Old: `query: "assignee:null"`
24
+ - New: `assignee: "unassigned"` as a dedicated parameter
25
+ - Migrated from legacy `Server` class to modern `McpServer` with `registerTool()` API
26
+ - All tool responses now include structured output schemas for better type safety
27
+ - **Removed Git/GitHub tools**: The following tools have been removed to focus on core FreeScout functionality:
28
+ - `git_create_worktree`
29
+ - `git_remove_worktree`
30
+ - `github_create_pr`
31
+ - `freescout_implement_ticket`
32
+ - Use dedicated Git/GitHub MCP servers for these workflows
33
+
34
+ ### Added
35
+
36
+ - **Markdown-to-HTML conversion**: Draft replies now automatically convert Markdown formatting (bold, italic, code, lists) to proper HTML for FreeScout display
37
+ - **Zod schema validation** for all FreeScout API types with runtime validation
38
+ - **Explicit search filters**:
39
+ - `assignee`: 'unassigned' | 'any' | number
40
+ - `updatedSince`: ISO date or relative time (e.g., "7d", "24h")
41
+ - `createdSince`: ISO date or relative time
42
+ - `page` and `pageSize`: Proper pagination support
43
+ - `mailboxId`, `status`, `state`: First-class filter parameters
44
+ - **Exponential backoff retry logic** with jitter for transient API failures
45
+ - **Rate limiting awareness**: Automatic detection and backoff for 429 responses
46
+ - **Timeout handling**: Configurable request timeouts (default: 30s)
47
+ - **Structured content responses**: All tools now return typed `structuredContent` alongside text
48
+ - **Relative time parsing**: Support for "7d", "24h", "30m" in date filters
49
+
50
+ ### Changed
51
+
52
+ - Updated to MCP SDK best practices (January 2026)
53
+ - Improved error messages with specific status codes and retry information
54
+ - Enhanced type safety with Zod schemas throughout the codebase
55
+ - Better input normalization and validation
56
+
57
+ ### Fixed
58
+
59
+ - Eliminated client-side filtering workarounds for search state parameter
60
+ - Removed fragile string matching for special query syntax
61
+ - Improved reliability with automatic retries for network errors
62
+ - Windows compatibility: README config examples now use args array format to prevent path separator issues
63
+
64
+ ### Infrastructure
65
+
66
+ - Added GitHub Actions CI/CD with automated testing and npm publishing
67
+ - Added MCP Registry publishing for discoverability
68
+ - ESLint 9 flat config with typescript-eslint 8
69
+ - Security scanning with CodeQL and Dependabot
70
+
71
+ ### Migration Guide
72
+
73
+ If you were using `freescout_search_tickets` with query strings like `"assignee:null"`:
74
+
75
+ **Before (v1.x):**
76
+
77
+ ```json
78
+ {
79
+ "query": "assignee:null",
80
+ "status": "active"
81
+ }
82
+ ```
83
+
84
+ **After (v2.0):**
85
+
86
+ ```json
87
+ {
88
+ "assignee": "unassigned",
89
+ "status": "active"
90
+ }
91
+ ```
92
+
93
+ For text search, use the `textSearch` parameter:
94
+
95
+ ```json
96
+ {
97
+ "textSearch": "authentication error",
98
+ "assignee": "unassigned",
99
+ "updatedSince": "7d"
100
+ }
101
+ ```
102
+
103
+ ## [1.4.2] - 2025-11-20
104
+
105
+ ### Added
106
+
107
+ - MCP Registry support with `mcpName` configuration
108
+ - GitHub Actions CI/CD workflows
109
+ - Dependabot configuration for dependency updates
110
+ - Security scanning with CodeQL
111
+
112
+ ### Changed
113
+
114
+ - Updated package.json with `engines` and `publishConfig`
115
+
116
+ ## [1.4.1] - 2025-11-15
117
+
118
+ ### Fixed
119
+
120
+ - Improved error handling in ticket operations
121
+
122
+ ## [1.4.0] - 2025-11-10
123
+
124
+ ### Added
125
+
126
+ - Git worktree integration for ticket-based development
127
+ - GitHub PR creation support
128
+
129
+ ## [1.3.0] - 2025-10-15
130
+
131
+ ### Added
132
+
133
+ - Ticket context retrieval for personalized replies
134
+ - Draft reply creation functionality
135
+
136
+ ## [1.2.0] - 2025-09-20
137
+
138
+ ### Added
139
+
140
+ - Ticket search functionality
141
+ - Note addition to tickets
142
+
143
+ ## [1.1.0] - 2025-08-15
144
+
145
+ ### Added
146
+
147
+ - Ticket status updates
148
+ - Ticket assignment
149
+
150
+ ## [1.0.0] - 2025-07-01
151
+
152
+ ### Added
153
+
154
+ - Initial release
155
+ - FreeScout ticket fetching
156
+ - Ticket analysis with AI
157
+ - Basic ticket operations
package/CLAUDE.md ADDED
@@ -0,0 +1,111 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code when working with this repository.
4
+
5
+ ## Project Overview
6
+
7
+ **MCP FreeScout** is an MCP server for FreeScout helpdesk integration. It enables AI assistants to manage support tickets, analyze issues, create responses, and integrate with Git workflows.
8
+
9
+ ## Build & Development
10
+
11
+ ```bash
12
+ # Build TypeScript to dist/
13
+ npm run build
14
+
15
+ # Development with hot-reload
16
+ npm run dev
17
+
18
+ # Run tests
19
+ npm test
20
+
21
+ # Lint code
22
+ npm run lint
23
+
24
+ # Format code
25
+ npm run format
26
+ ```
27
+
28
+ ## Architecture
29
+
30
+ ```
31
+ src/
32
+ ├── index.ts # MCP server entry point, tool registration
33
+ ├── freescout-api.ts # FreeScout API client
34
+ ├── ticket-analyzer.ts # AI-powered ticket analysis
35
+ ├── git-integration.ts # Git worktree and GitHub PR support
36
+ └── types.ts # TypeScript interfaces
37
+ ```
38
+
39
+ ## MCP Tools
40
+
41
+ The server exposes these tools:
42
+
43
+ ### Ticket Management
44
+
45
+ - **freescout_get_ticket** - Fetch ticket by ID or URL with threads
46
+ - **freescout_analyze_ticket** - Analyze ticket to determine issue type and solution
47
+ - **freescout_add_note** - Add internal note to ticket
48
+ - **freescout_update_ticket** - Update ticket status and assignment
49
+ - **freescout_create_draft_reply** - Create draft reply for review
50
+ - **freescout_get_ticket_context** - Get ticket context for personalized replies
51
+ - **freescout_search_tickets** - Search tickets by query and filters
52
+
53
+ ### Git Integration
54
+
55
+ - **git_create_worktree** - Create Git worktree for ticket work
56
+ - **git_remove_worktree** - Remove worktree after completion
57
+ - **github_create_pr** - Create GitHub PR for ticket branch
58
+
59
+ ### Workflow
60
+
61
+ - **freescout_implement_ticket** - Full workflow: analyze, worktree, plan
62
+
63
+ ## Environment Variables
64
+
65
+ ```env
66
+ # Required: FreeScout instance URL
67
+ FREESCOUT_URL=https://your-freescout.example.com
68
+
69
+ # Required: FreeScout API key
70
+ FREESCOUT_API_KEY=your_api_key
71
+
72
+ # Optional: Default user ID for notes/drafts
73
+ FREESCOUT_USER_ID=1
74
+
75
+ # Optional: Git worktree base path
76
+ WORKTREE_BASE_PATH=/path/to/worktrees
77
+
78
+ # Optional: GitHub token for PR creation
79
+ GITHUB_TOKEN=ghp_xxxx
80
+ ```
81
+
82
+ ## Common Tasks
83
+
84
+ **Add a new tool:**
85
+
86
+ 1. Define tool schema in `src/index.ts` tools array
87
+ 2. Add handler in `CallToolRequestSchema` switch
88
+ 3. Implement API method in `freescout-api.ts`
89
+ 4. Add types in `types.ts`
90
+
91
+ **Test a specific tool:**
92
+
93
+ ```bash
94
+ echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"freescout_get_ticket","arguments":{"ticket":"12345"}},"id":1}' | npm start
95
+ ```
96
+
97
+ ## API Patterns
98
+
99
+ The FreeScout API client uses:
100
+
101
+ - Basic authentication with API key
102
+ - JSON request/response format
103
+ - Pagination for list endpoints
104
+ - Status codes: active, pending, closed, spam
105
+
106
+ ## Important Notes
107
+
108
+ - Ticket IDs can be provided as number, string, or full URL
109
+ - Thread content is HTML, cleaned with DOMPurify before display
110
+ - Draft replies require user review before sending
111
+ - Worktrees are created in `./worktrees/` by default