Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

on:
push:
branches:
- main
- beta

jobs:
run_build:
# Running only on self hosted runner which has tag "build"
runs-on: [self-hosted, build]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
actions: write
issues: write
pull-requests: write

environment: build

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- id: install-dev
name: Install npm development dependencies
run: npm ci --no-audit --silent
- id: build
name: Build
run: npm run build
- id: semantic-release
name: Run semantic release
run: npm run semantic-release
env:
CI: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_REGISTRY: ${{ env.NPM_CONFIG_REGISTRY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can use this directly in the [GitHub Copilot](https://docs.github.com/en/cop
You can use this directly in the [Claude Code](https://docs.anthropic.com/en/docs/claude-code/mcp), by running:

```bash
claude mcp add airtable --env CLIENT_ID=YOUR_CLIENT_ID --env APP_ID=YOUR_APP_ID -- npx -y @chargetrip/mcp
claude mcp add chargetrip --env CLIENT_ID=YOUR_CLIENT_ID --env APP_ID=YOUR_APP_ID -- npx -y @chargetrip/mcp
```

### Other AI agents
Expand Down
3 changes: 0 additions & 3 deletions bin/chargetrip-mcp.js

This file was deleted.

3 changes: 3 additions & 0 deletions bin/chargetrip-mcp.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

import '../dist/index.cjs';
File renamed without changes.
6 changes: 3 additions & 3 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'js', 'json'],
moduleNameMapper: {
'graceful-fs': '<rootDir>/test/jest/fs.js',
'fs/promises': '<rootDir>/test/jest/fs.js',
'graceful-fs': '<rootDir>/test/jest/fs.cjs',
'fs/promises': '<rootDir>/test/jest/fs.cjs',
},
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended/all', './test/jest/matchers.ts'],
testSequencer: './test/jest/sequencer.js',
testSequencer: './test/jest/sequencer.cjs',

testTimeout: 20000,
testMatch: [
Expand Down
2 changes: 1 addition & 1 deletion jest.e2e.config.js → jest.e2e.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const jestConfig = require('./jest.config');
const jestConfig = require('./jest.config.cjs');

module.exports = {
...jestConfig,
Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 100 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@chargetrip/mcp",
"version": "0.1.0",
"description": "Chargetrip MCP server",
"main": "dist/index.js",
"version": "0.0.1",
"description": "Chargetrip MCP server ",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"type": "commonjs",
"type": "module",
"bin": {
"chargetrip-mcp": "./bin/chargetrip-mcp.js"
"chargetrip-mcp": "./bin/chargetrip-mcp.mjs"
},
"files": [
"dist/",
Expand All @@ -15,20 +15,23 @@
],
"packageManager": "npm@10.0.0",
"scripts": {
"dev": "webpack --watch --config ./webpack.config.js",
"build": "webpack --config ./webpack.config.js",
"dev": "webpack --watch --config ./webpack.config.mjs",
"build": "webpack --config ./webpack.config.mjs",
"lint": "oxlint -c .oxlintrc ./src",
"test": "node --expose-gc ./node_modules/.bin/jest -c ./jest.config.js --forceExit --maxWorkers=50% --unhandled-rejections=none",
"test:e2e": "node --unhandled-rejections=none --expose-gc ./node_modules/.bin/jest -c ./jest.e2e.config.js --forceExit --runInBand",
"test": "node --expose-gc ./node_modules/.bin/jest -c ./jest.config.cjs --forceExit --maxWorkers=50% --unhandled-rejections=none",
"test:e2e": "node --unhandled-rejections=none --expose-gc ./node_modules/.bin/jest -c ./jest.e2e.config.cjs --forceExit --runInBand",
"type-check": "tsc --noEmit",
"semantic-release": "semantic-release",
"prepare": "husky",
"prettier": "prettier -w ./src/**/*.ts",
"commitlint": "commitlint --edit"
"commitlint": "commitlint --config commitlint.config.cjs --edit"
},
"keywords": [
"chargetrip",
"mcp"
],
"repository": "https://github.com/chargetrip/mcp",
"bugs": "https://github.com/chargetrip/mcp/issues",
"author": "Chargetrip Developer Team <dev@chargetrip.com>",
"homepage": "https://chargetrip.com/",
"license": "MIT",
Expand All @@ -40,6 +43,7 @@
"dotenv": "^17.2.1",
"graphql-tag": "^2.12.6",
"graphql-ws": "^6.0.6",
"husky": "^9.1.7",
"winston": "^3.17.0",
"ws": "^8.18.3",
"zod": "^3.25.76"
Expand All @@ -64,7 +68,6 @@
"@types/ws": "^8.18.1",
"babel-loader": "^10.0.0",
"eslint-plugin-oxlint": "^1.12.0",
"husky": "^9.1.7",
"jest": "^30.0.5",
"jest-extended": "^6.0.0",
"os": "^0.1.2",
Expand All @@ -79,5 +82,91 @@
"webpack": "^5.101.1",
"webpack-cli": "^6.0.1",
"webpack-node-externals": "^3.0.0"
},
"publishConfig": {
"access": "public"
},
"release": {
"branches": [
{
"name": "beta",
"prerelease": true
},
{
"name": "main",
"prerelease": false
}
],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "*",
"scope": "*",
"release": false
},
{
"breaking": true,
"release": "major"
},
{
"type": "docs",
"scope": "*",
"release": false
},
{
"type": "feat",
"scope": "*",
"release": "minor"
},
{
"type": "fix",
"scope": "*",
"release": "patch"
},
{
"type": "perf",
"scope": "*",
"release": "patch"
},
{
"type": "refactor",
"scope": "*",
"release": false
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES"
]
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json",
"package-lock.json"
],
"message": "chore: release version ${nextRelease.version}"
}
],
"@semantic-release/github",
"@semantic-release/npm"
]
}
}
2 changes: 1 addition & 1 deletion src/__e2e__/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
* @description Setting up the MCP client and transport for the E2E tests
*/
export async function getMcpClient() {
const mcpIndexFile = process.cwd() + '/dist/index.js';
const mcpIndexFile = process.cwd() + '/dist/index.cjs';

const env: Record<string, string> = {
CLIENT_ID: process.env.CLIENT_ID!,
Expand Down
File renamed without changes.
File renamed without changes.
37 changes: 19 additions & 18 deletions webpack.config.js → webpack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require('webpack-node-externals');
import path from 'path';
import webpack from 'webpack';
import nodeExternals from 'webpack-node-externals';
import dotenv from 'dotenv';

const util = {
env: require("dotenv").config(),
isProduction: process.env.NODE_ENV === 'production',
};
env: dotenv.config(),
isProduction: process.env.NODE_ENV === 'production',
},
__dirname = path.resolve();

module.exports = {
mode: util.isProduction ? "production" : "development",
export default {
mode: util.isProduction ? 'production' : 'development',
devtool: util.isProduction ? false : 'inline-source-map',
entry: "./src/index.ts",
entry: './src/index.ts',
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
filename: 'index.cjs',
path: path.resolve(__dirname, 'dist'),
},
plugins: [],
externals: [
Expand All @@ -28,17 +30,17 @@ module.exports = {
rules: [
{
test: /\.ts$/,
use: "ts-loader",
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.js$/,
include: [path.resolve(__dirname, "src")],
loader: "babel-loader",
include: [path.resolve(__dirname, 'src')],
loader: 'babel-loader',
options: {
presets: [
[
"@babel/preset-env",
'@babel/preset-env',
{
modules: false,
},
Expand All @@ -49,9 +51,8 @@ module.exports = {
],
},
resolve: {
extensions: [".ts", ".js"],
alias: {
},
extensions: ['.ts', '.js'],
alias: {},
fallback: {
crypto: false,
util: false,
Expand Down