Skip to content

feat: Add separate MCP server package #201

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

Merged
merged 9 commits into from
May 12, 2025
Merged

feat: Add separate MCP server package #201

merged 9 commits into from
May 12, 2025

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented May 6, 2025

Prerequisites checklist

What is the purpose of this pull request?

Adds a new @eslint/mcp package.

What changes did you make? (Give an overview)

  • Ported mcp-server.js from the eslint repo, along with tests.
  • Updated related files for the monorepo to reflect the new package

Related Issues

refs eslint/eslint#19682

Is there anything you'd like reviewers to focus on?

This package has no JSR equivalent because it's a binary.

Also, because it's a binary, I'm not rolling up or converting to CommonJS. It stays ESM and the src directory is published.

These were simplifying decisions based on the uniqueness of this package. I think this is okay because there is no API exposed through the package.

@nzakas
Copy link
Member Author

nzakas commented May 6, 2025

The failure is a Mocha timeout. Seems intermittent.

@nzakas nzakas requested a review from Copilot May 6, 2025 18:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new @eslint/mcp package that implements an MCP server for ESLint along with its CLI and accompanying tests and configuration updates.

  • Port the existing mcp-server.js into the new package with a corresponding CLI executable.
  • Add tests for both the MCP server and CLI, as well as update documentation, workflows, and issue templates to support the new package.

Reviewed Changes

Copilot reviewed 15 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/mcp/tests/mcp-server.test.js Added tests for MCP server tools functionality
packages/mcp/tests/mcp-cli.js Added CLI tests to verify startup behavior
packages/mcp/tests/fixtures/* Added fixture files for testing linting outcomes
packages/mcp/src/mcp-server.js Implemented the MCP server using ESLint integration
packages/mcp/src/mcp-cli.js Provided a CLI to initialize and run the MCP server
packages/mcp/README.md Updated documentation to include usage for the new package
Other configuration files (.github/workflows, etc.) Updated CI/workflows and issue templates to include the MCP package
Files not reviewed (4)
  • .release-please-manifest.json: Language not supported
  • packages/mcp/package.json: Language not supported
  • packages/mcp/tsconfig.json: Language not supported
  • release-please-config.json: Language not supported

@fasttime fasttime moved this from Needs Triage to Implementing in Triage May 7, 2025
nzakas and others added 3 commits May 8, 2025 11:02
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Leaving open for @fasttime to verify.

Comment on lines +23 to +26
// Important: Cursor throws an error when `describe()` is used in the schema.
const filePathsSchema = {
filePaths: z.array(z.string().min(1)).nonempty(),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Important: Cursor throws an error when `describe()` is used in the schema.
const filePathsSchema = {
filePaths: z.array(z.string().min(1)).nonempty(),
};
const filePathsSchema = {
filePaths: z
.array(
z
.string()
.min(1)
.describe("Full filesystem path of a file to be analyzed"),
)
.nonempty(),
};

I can't reproduce the error in Cursor anymore. I tried to re-add the description from this commit and I configured Cursor to start the server directly from the path of mcp-cli.js. I can see that lint-file is working as expected now. How is it for you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to stick with what we knew already worked in the previous release in this PR. We can make other changes like this as improvements later.

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fasttime fasttime merged commit 99f41cf into main May 12, 2025
18 checks passed
@fasttime fasttime deleted the mcp branch May 12, 2025 14:39
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage May 12, 2025
@github-actions github-actions bot mentioned this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

3 participants