Skip to content

Commit 9ffbf9a

Browse files
committed
feat: build system and number linking
1 parent 0e7a95d commit 9ffbf9a

File tree

12 files changed

+2076
-239
lines changed

12 files changed

+2076
-239
lines changed

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Ensure consistent line endings across platforms
2+
* text=auto eol=lf
3+
4+
# Specific file types that should have Unix line endings
5+
*.ts text eol=lf
6+
*.js text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
*.yaml text eol=lf
11+
*.sh text eol=lf
12+
13+
# Binary files
14+
*.png binary
15+
*.jpg binary
16+
*.jpeg binary
17+
*.gif binary
18+
*.ico binary
19+
*.pdf binary

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
65
pull_request:
7-
branches: [ main, develop ]
6+
branches: [main]
87

98
jobs:
109
build-and-test:
1110
runs-on: ubuntu-latest
12-
11+
1312
strategy:
1413
matrix:
1514
node-version: [18, 20, 22]
16-
15+
1716
steps:
1817
- name: Checkout code
1918
uses: actions/checkout@v4
@@ -27,9 +26,14 @@ jobs:
2726
- name: Install dependencies
2827
run: make install
2928

30-
- name: Run linting (if configured)
29+
- name: Check code formatting
30+
run: make format-check
31+
32+
- name: Run linting
3133
run: make lint
32-
continue-on-error: true
34+
35+
- name: Run type checking
36+
run: make typecheck
3337

3438
- name: Run tests
3539
run: make test
@@ -50,7 +54,7 @@ jobs:
5054
package-validation:
5155
runs-on: ubuntu-latest
5256
needs: build-and-test
53-
57+
5458
steps:
5559
- name: Checkout code
5660
uses: actions/checkout@v4
@@ -64,11 +68,14 @@ jobs:
6468
- name: Install dependencies
6569
run: make install
6670

71+
- name: Run all quality checks
72+
run: make check
73+
6774
- name: Build package
6875
run: make build
6976

7077
- name: Validate package.json
7178
run: make info
7279

7380
- name: Dry run publish
74-
run: make validate
81+
run: make validate

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
permissions:
1818
contents: read
1919
id-token: write
20-
20+
2121
steps:
2222
- name: Checkout code
2323
uses: actions/checkout@v4
@@ -60,13 +60,13 @@ jobs:
6060
release_name: Release ${{ github.ref_name }}
6161
body: |
6262
## Changes in this Release
63-
63+
6464
See the [CHANGELOG](./CHANGELOG.md) for detailed information about this release.
65-
65+
6666
## Installation
67-
67+
6868
```bash
6969
npm install @vonage/vonage-mcp-server-api-bindings@${{ github.ref_name }}
7070
```
7171
draft: false
72-
prerelease: false
72+
prerelease: false

.prettierignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Ignore build artifacts
2+
build/
3+
dist/
4+
node_modules/
5+
6+
# Ignore package files
7+
package-lock.json
8+
*.tgz
9+
10+
# Ignore git files
11+
.git/
12+
13+
# Ignore IDE files
14+
.vscode/
15+
.idea/
16+
17+
# Ignore OS files
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Ignore log files
22+
*.log
23+
npm-debug.log*

.prettierrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "avoid",
10+
"endOfLine": "lf",
11+
"quoteProps": "as-needed",
12+
"bracketSameLine": false,
13+
"overrides": [
14+
{
15+
"files": "*.md",
16+
"options": {
17+
"printWidth": 100,
18+
"proseWrap": "always"
19+
}
20+
},
21+
{
22+
"files": "*.json",
23+
"options": {
24+
"tabWidth": 2
25+
}
26+
}
27+
]
28+
}

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@ start: ## Start the built application
3131
npm run start
3232

3333
# Quality checks
34+
format: ## Format code with Prettier
35+
npm run format
36+
37+
format-check: ## Check code formatting
38+
npm run format:check
39+
40+
lint: ## Run ESLint
41+
npm run lint
42+
43+
lint-fix: ## Fix ESLint issues
44+
npm run lint:fix
45+
46+
typecheck: ## Run TypeScript type checking
47+
npm run typecheck
48+
49+
check: ## Run all quality checks (format, lint, typecheck)
50+
npm run check
51+
52+
fix: ## Fix all auto-fixable issues (format and lint)
53+
npm run fix
54+
3455
check-clean: ## Check if working directory is clean
3556
@if [ -n "$$(git status --porcelain)" ]; then \
3657
echo "❌ Working directory is not clean. Please commit or stash changes."; \
@@ -58,6 +79,8 @@ pre-release: check-branch check-clean ## Run all pre-release checks
5879
@echo "🔍 Running pre-release checks..."
5980
@echo "📥 Pulling latest changes..."
6081
git pull origin main
82+
@echo "🎨 Checking code formatting..."
83+
$(MAKE) check
6184
@echo "🧪 Running tests..."
6285
$(MAKE) test
6386
@echo "🔨 Building project..."
@@ -108,6 +131,7 @@ setup: ## Initial project setup
108131
validate: ## Validate the package without publishing
109132
@echo "✅ Validating package structure..."
110133
@node -e "const pkg = require('./package.json'); console.log('Package:', pkg.name, 'v' + pkg.version)"
134+
$(MAKE) check
111135
$(MAKE) build
112136
npm publish --dry-run
113137
@echo "✅ Package validation passed"

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,50 @@
44

55
This MCP server provides access to various Vonage API functionalities through the following tools:
66

7-
| Category | Tool Name | Description |
8-
|----------|-----------|-------------|
9-
| **Account Management** | `balance` | Get your Vonage account balance |
10-
| | `list-applications` | List all applications attached to your API key with their configurations and capabilities |
11-
| | `list-purchased-numbers` | List telephone numbers associated with your account and their metadata |
12-
| **Number Management** | `link-number-to-vonage-application` | Link an owned number to a specific Vonage Application |
13-
| **Messaging & Communication** | `SMS` | Send SMS messages using Vonage |
14-
| | `outbound-voice-message` | Send outbound voice messages with Vonage |
7+
| Category | Tool Name | Description |
8+
| ----------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------- |
9+
| **Account Management** | `balance` | Get your Vonage account balance |
10+
| | `list-applications` | List all applications attached to your API key with their configurations and capabilities |
11+
| | `list-purchased-numbers` | List telephone numbers associated with your account and their metadata |
12+
| **Number Management** | `link-number-to-vonage-application` | Link an owned number to a specific Vonage Application |
13+
| **Messaging & Communication** | `SMS` | Send SMS messages using Vonage |
14+
| | `outbound-voice-message` | Send outbound voice messages with Vonage |
1515

1616
### Usage Examples
1717

1818
#### Check Account Balance
19+
1920
```
2021
Can you check my Vonage account balance?
2122
```
2223

2324
#### List Your Phone Numbers
25+
2426
```
2527
Can you list out the numbers that I own for Vonage?
2628
```
2729

2830
#### List Applications
31+
2932
```
3033
Can you list out the applications on my account?
3134
```
3235

3336
#### Send an SMS
37+
3438
```
3539
Can you send an SMS to +1234567890 with the message "Hello from Vonage!"?
3640
```
3741

3842
## Set up the MCP server
43+
3944
- [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server)
4045
- [Cursor](https://docs.cursor.com/context/mcp)
4146
- [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
4247
- [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
4348

4449
The details of the MCP server should look like this.
50+
4551
```JSON
4652
"vonage-mcp-server-api-bindings": {
4753
"type": "stdio",
@@ -60,5 +66,7 @@ The details of the MCP server should look like this.
6066
}
6167
```
6268

63-
> Right now, we only use a base64 encoded Private Key. I created a tool that will convert the private key file into the encoded string that you can copy and paste. Everything is done in your browser, no inforamtion is sent anywhere: [https://mylight.work/private-key-to-environment-variable](https://mylight.work/private-key-to-environment-variable)
64-
69+
> Right now, we only use a base64 encoded Private Key. I created a tool that will convert the
70+
> private key file into the encoded string that you can copy and paste. Everything is done in your
71+
> browser, no inforamtion is sent anywhere:
72+
> [https://mylight.work/private-key-to-environment-variable](https://mylight.work/private-key-to-environment-variable)

eslint.config.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsparser from '@typescript-eslint/parser';
4+
import prettier from 'eslint-plugin-prettier';
5+
import prettierConfig from 'eslint-config-prettier';
6+
import globals from 'globals';
7+
8+
export default [
9+
js.configs.recommended,
10+
{
11+
files: ['src/**/*.ts'],
12+
languageOptions: {
13+
parser: tsparser,
14+
parserOptions: {
15+
ecmaVersion: 2022,
16+
sourceType: 'module',
17+
project: './tsconfig.json',
18+
},
19+
globals: {
20+
...globals.node,
21+
},
22+
},
23+
plugins: {
24+
'@typescript-eslint': tseslint,
25+
prettier: prettier,
26+
},
27+
rules: {
28+
...tseslint.configs.recommended.rules,
29+
...prettierConfig.rules,
30+
// TypeScript specific rules
31+
'@typescript-eslint/no-unused-vars': [
32+
'error',
33+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
34+
],
35+
'@typescript-eslint/no-explicit-any': 'warn',
36+
'@typescript-eslint/explicit-function-return-type': 'off',
37+
'@typescript-eslint/explicit-module-boundary-types': 'off',
38+
'@typescript-eslint/no-non-null-assertion': 'warn',
39+
40+
// General rules
41+
'no-console': 'warn',
42+
'prefer-const': 'error',
43+
'no-var': 'error',
44+
'no-trailing-spaces': 'error',
45+
'eol-last': 'error',
46+
47+
// Prettier integration
48+
'prettier/prettier': 'error',
49+
},
50+
},
51+
{
52+
files: ['**/*.js', '**/*.mjs'],
53+
languageOptions: {
54+
ecmaVersion: 2022,
55+
sourceType: 'module',
56+
},
57+
},
58+
{
59+
ignores: ['build/', 'dist/', 'node_modules/', '*.d.ts', 'coverage/'],
60+
},
61+
];

0 commit comments

Comments
 (0)