-
Notifications
You must be signed in to change notification settings - Fork 8
Convert the project to use Node.js type stripping #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| **/.env* | ||
| **/.git | ||
| **/.idea | ||
| **/.config | ||
| **/.npm | ||
| **/.github | ||
| **/.DS_Store | ||
| **/.gitignore | ||
| **/.scannerwork | ||
| **/.editorconfig | ||
| **/certs | ||
| **/nodemon.json | ||
| **/node_modules | ||
| **/npm-debug.log | ||
| **/public | ||
| **/.dtx |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
| name: tests | ||
|
|
||
| on: [pull_request, push] | ||
|
|
||
| env: | ||
| FORCE_COLOR: 1 | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| node: ['lts/*'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| - run: npm i | ||
| - run: npm test --color=always | ||
| env: | ||
| SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| node_modules | ||
| sandbox.js | ||
| .nyc_output | ||
| package-lock.json | ||
| public | ||
| coverage | ||
| .tap | ||
| .nova | ||
| .dtx |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,10 +9,7 @@ COPY *.json ./ | |
| RUN npm install --ignore-scripts | ||
|
|
||
| # Copy all source code | ||
| COPY src ./src | ||
|
|
||
| # Build the application | ||
| RUN npm run build | ||
| COPY . . | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is so that as the project grows you don't have to constantly update a file list. You are free to change this if you prefer. |
||
|
|
||
| # Environment variables for configuration | ||
| ENV MCP_PORT="3000" | ||
|
|
@@ -21,4 +18,4 @@ ENV MCP_PORT="3000" | |
| EXPOSE ${MCP_PORT} | ||
|
|
||
| # Command to run the server | ||
| CMD [ "node", "build/index.js" , "--http"] | ||
| CMD [ "node", "--experimental-strip-types", "index.ts" , "--http"] | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need to build in production either! |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ Alternatively, you can manually add it to your VS Code MCP configuration in `.vs | |
| { | ||
| "servers": { | ||
| "socket-mcp": { | ||
| "type": "http", | ||
| "type": "http", | ||
| "url": "https://mcp.socket.dev/" | ||
| } | ||
| } | ||
|
|
@@ -148,7 +148,7 @@ For local deployment, you have two options: | |
|
|
||
| Click a button below to install the self-hosted stdio server in your favorite AI assistant. | ||
|
|
||
| [](https://vscode.dev/redirect/mcp/install?name=socket-mcp&config={"command":"npx","args":["@socketsecurity/mcp@latest"],"type":"stdio"}) | ||
| [](https://vscode.dev/redirect/mcp/install?name=socket-mcp&config={"command":"npx","args":["@socketsecurity/mcp@latest"],"type":"stdio"}) | ||
| [](https://cursor.com/install-mcp?name=socket-mcp-stdio&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAc29ja2V0c2VjdXJpdHkvbWNwQGxhdGVzdCJdLCJlbnYiOnsiU09DS0VUX0FQSV9LRVkiOiJ5b3VyLWFwaS1rZXktaGVyZSJ9fQ==) | ||
|
|
||
| Claude Code (stdio mode) can be set up with the following command: | ||
|
|
@@ -220,7 +220,7 @@ The `depscore` tool allows AI assistants to query the Socket API for dependency | |
| "version": "4.18.2" | ||
| }, | ||
| { | ||
| "ecosystem": "pypi", | ||
| "ecosystem": "pypi", | ||
| "depname": "fastapi", | ||
| "version": "0.100.0" | ||
| } | ||
|
|
@@ -241,7 +241,7 @@ pkg:pypi/[email protected]: supply_chain: 1.0, quality: 0.95, maintenance: 0.98, v | |
| - "Analyze the security of my package.json dependencies" | ||
| - "What are the vulnerability scores for react, lodash, and axios?" | ||
|
|
||
| 2. **Get comprehensive security insights** including supply chain, quality, maintenance, vulnerability, and license scores. | ||
| 2. **Get comprehensive security insights** including supply chain, quality, maintenance, vulnerability, and license scores. | ||
|
|
||
| ### Adjust tool usage with custom rules | ||
|
|
||
|
|
@@ -317,7 +317,14 @@ npm install | |
|
|
||
| #### Build | ||
|
|
||
| To build the project: | ||
| This project is a directly runnable Node.js project using [Type stripping](https://nodejs.org/docs/latest/api/typescript.html). | ||
| If you are on Node.js 22, run with `node --experimental-strip-types index.ts`. | ||
| On any later versions of Node.js, you can simply run `node index.ts`. | ||
| In either version you can also run the npm run scripts which include the correct flags. | ||
|
|
||
| The js files will automatically be build when running `npm publish`, and cleaned up afterwards with `npm run clean`. | ||
|
|
||
| If you want to preview the build you can run: | ||
|
|
||
| ```bash | ||
| npm run build | ||
|
|
@@ -329,13 +336,13 @@ To run the Socket MCP server from source: | |
|
|
||
| ```bash | ||
| export SOCKET_API_KEY=your_api_key_here | ||
| node build/index.js | ||
| node --experimental-strip-types index.ts | ||
| ``` | ||
|
|
||
| Or in HTTP mode: | ||
|
|
||
| ```bash | ||
| MCP_HTTP_MODE=true SOCKET_API_KEY=your_api_key_here node build/index.js --http | ||
| MCP_HTTP_MODE=true SOCKET_API_KEY=your_api_key_here node --experimental-strip-types index.ts --http | ||
| ``` | ||
|
|
||
| ## 🔧 Troubleshooting | ||
|
|
@@ -358,7 +365,7 @@ MCP_HTTP_MODE=true SOCKET_API_KEY=your_api_key_here node build/index.js --http | |
| - Try regenerating your API key from the Socket dashboard | ||
|
|
||
| **Q: AI assistant can't find the depscore tool** | ||
| - Restart your MCP client after configuration changes | ||
| - Restart your MCP client after configuration changes | ||
| - Verify the server configuration is saved correctly | ||
| - Check that the MCP server is running (for local deployments) | ||
|
|
||
|
|
@@ -367,4 +374,3 @@ MCP_HTTP_MODE=true SOCKET_API_KEY=your_api_key_here node build/index.js --http | |
| - 📖 [Socket Documentation](https://docs.socket.dev) | ||
| - 🐛 [Report Issues](https://github.com/SocketDev/socket-mcp/issues) | ||
| - 💬 [Community Support](https://github.com/SocketDev/socket-mcp/discussions) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to
-instead of:to disambiguate npm scripts that are run with globs and those just grouped together that don't run together.