Skip to content

Commit aa684bd

Browse files
authored
Merge pull request #17 from nearai/fix-cli
Fix cli
2 parents e71c6ef + 8de5d36 commit aa684bd

8 files changed

Lines changed: 23 additions & 19 deletions

File tree

.prettierignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,4 @@ coverage
3434
.github/
3535

3636
# JSON files
37-
**/*.json
38-
39-
# Skip files with module/CommonJS conflicts
40-
bin/run.ts
41-
bin/
37+
**/*.json

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @nearai/near-mcp
22

3+
## 0.0.30
4+
5+
### Patch Changes
6+
7+
- Change build
8+
39
## 0.0.29
410

511
### Patch Changes

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Thank you for your interest in contributing to NEAR MCP! This document provides
4545
```
4646
Then add the `near-mcp` tool to the `claude` cli:
4747
```bash
48-
claude mcp add near-mcp ./bin/run run
48+
claude mcp add near-mcp bun run cli
4949
```
5050
This adds the `near-mcp` tool to the `claude` cli from your local build.
5151
3. Run the TypeScript compiler to check for type errors:

bin/run.cmd

Lines changed: 0 additions & 2 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default [
2626
'build/**',
2727
'out/**',
2828
'.near-keystore/**',
29-
'bin/**',
3029
],
3130
},
3231
...compat.extends(

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nearai/near-mcp",
3-
"version": "0.0.29",
3+
"version": "0.0.30",
44
"description": "MCP server for interacting with Near Blockchain",
55
"homepage": "https://github.com/near-ai/near-mcp",
66
"repository": {
@@ -13,23 +13,23 @@
1313
"lint": "eslint . --ext .ts,.tsx",
1414
"lint:fix": "eslint . --ext .ts,.tsx --fix",
1515
"typecheck": "tsc --noEmit",
16-
"build": "rm -rf dist/* && tsc --outDir dist && shx chmod +x dist/**/*.js bin/*.js",
17-
"cli": "bin/near-mcp.js"
16+
"build": "rm -rf dist/* && bun build --sourcemap=external --entrypoints $(find ./src -name '*.ts' | grep -v '*.test.ts') --target node --outdir dist/ && bun run build:declaration",
17+
"build:declaration": "tsc --emitDeclarationOnly",
18+
"cli": "bun run build && dist/near-mcp.js"
1819
},
1920
"keywords": [],
2021
"author": "",
2122
"license": "MIT",
2223
"type": "module",
23-
"main": "bin/near-mcp.js",
24+
"main": "dist/near-mcp.js",
2425
"types": "dist/index.d.ts",
2526
"publishConfig": {
2627
"access": "public"
2728
},
2829
"bin": {
29-
"near-mcp": "bin/near-mcp.js"
30+
"near-mcp": "dist/near-mcp.js"
3031
},
3132
"files": [
32-
"bin",
3333
"dist"
3434
],
3535
"bundleDependencies": [],

bin/near-mcp.js renamed to src/near-mcp.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#!/usr/bin/env sh
2-
":" //; command -v bun >/dev/null && exec /usr/bin/env bun "$0" "$@" || exec /usr/bin/env node --no-warnings --import tsx "$0" "$@"
3-
1+
#!/usr/bin/env node
42
import { execute } from '@oclif/core';
53
import { dirname } from 'path';
64
import { fileURLToPath } from 'url';
@@ -15,4 +13,9 @@ async function run() {
1513
process.exit(1);
1614
}
1715
}
18-
run();
16+
void run();
17+
18+
run().catch((error) => {
19+
console.error('Unhandled error:', error);
20+
process.exit(1);
21+
});

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"esnext",
2020
"dom"
2121
],
22+
"rootDir": "src",
2223
"outDir": "dist",
2324
"declaration": true,
2425
"declarationMap": true,
26+
"sourceMap": true,
2527
"module": "ESNext",
2628
"moduleResolution": "Bundler",
2729
/* Path Aliases */

0 commit comments

Comments
 (0)