Back to Home
lascam-UFU icon

lc-mcp-server

Verified Safe

by lascam-UFU

Overview

Provides a Model Context Protocol (MCP) server to programmatically interact with LeetCode problems, contests, and solution submissions.

Installation

Run Command
go run main.go

Environment Variables

  • LEETCODE_SESSION
  • LEETCODE_CSRF_TOKEN

Security Notes

The server primarily uses environment variables for sensitive session and CSRF tokens, a good practice. The `auth.go` helper uses `chromedp` to open a browser for manual login and cookie extraction. While `chromedp.Evaluate` is used to inject JavaScript, this is a standard and necessary pattern for browser automation, and the scripts are hardcoded, not derived from user input, mitigating `eval`-like risks. The extracted tokens are stored in a local file (`~/.leetcode_auth.json`) with restrictive permissions (0600), which is appropriate. Overall, the direct server logic in `main.go` does not show obvious RCE vulnerabilities or unsafe `eval` patterns. The primary security concern lies in the careful management of the `LEETCODE_SESSION` and `CSRF_TOKEN` by the user.

Similar Servers

Stats

Interest Score0
Security Score8
Cost ClassMedium
Avg Tokens300
Stars0
Forks0
Last Update2025-11-24

Tags

LeetCodeMCPGoAutomationCompetitive Programming