Back to Home
Lewis-R-L icon

gpt-mcp-server

by Lewis-R-L

Overview

An MCP server integrating with italki's API to provide language learning services, including teacher recommendations, language/country metadata, and personal calendar events, with an optional OAuth 2.0 authentication provider.

Installation

Run Command
node dist/mcp-server/main.js

Environment Variables

  • ICONS_CDN_BASE_URL
  • WIDGET_DOMAIN
  • PORT
  • USE_HTTPS
  • HTTPS_PORT
  • SSL_CERT_PATH
  • SSL_KEY_PATH
  • LOG_FORMAT
  • DISABLE_ACCESS_LOG
  • LOG_REQUEST_RESPONSE
  • MOCK_OAUTH_PROVIDER
  • OAUTH_DB_PATH
  • BASE_URL
  • OAUTH_ACCESS_TOKEN_LIFETIME
  • OAUTH_REFRESH_TOKEN_LIFETIME
  • OAUTH_AUTHORIZATION_CODE_LIFETIME
  • OAUTH_ALLOWED_SCOPES
  • OAUTH_DEFAULT_SCOPES
  • OAUTH_ISSUER
  • OAUTH_CLEANUP_INTERVAL
  • EXTERNAL_OAUTH_SERVER_URL
  • ITALKI_ASSET_FETCH_TIMEOUT_MS
  • ITALKI_FETCH_TIMEOUT_MS
  • ADMIN_PORT

Security Notes

CRITICAL ISSUES: 1. Weak Password Hashing: The mock OAuth provider (NeDBUsersStore) uses SHA256 for password hashing, which is not cryptographically secure for user credentials in production environments and is highly susceptible to brute-force and rainbow table attacks. The code acknowledges this is 'for demo purposes' but it's a severe vulnerability if used. 2. Access Token Logging: When `LOG_REQUEST_RESPONSE` environment variable is set to `true`, the full `Authorization` header (including sensitive access tokens) is explicitly logged in plaintext to the console (main.ts, `oauthHeaders.authorization` in access log middleware). This is a severe security risk as access tokens grant access to user data and should never be logged. 3. Wildcard CORS for Admin API: The admin API (admin-server.ts) uses `Access-Control-Allow-Origin: *` (wildcard CORS). While the local version runs on a separate port, the Vercel deployment integrates it into the main app. Exposing an administrative interface with such permissive CORS without strong authentication and origin checks is a high security risk. OTHER ISSUES: - Non-persistent Data in Serverless: The in-memory MCP sessions and the NeDB database (when `OAUTH_DB_PATH` points to `/tmp/db` on Vercel) are not persistent across serverless function invocations or server restarts, leading to data loss for OAuth clients, users, and sessions. This is a functional limitation, not a direct security flaw in the code logic itself, but impacts the reliability and security posture of the OAuth provider in a production serverless environment.

Similar Servers

Stats

Interest Score0
Security Score2
Cost ClassHigh
Avg Tokens200000
Stars0
Forks0
Last Update2025-12-22

Tags

italkiMCPOAuth2.0Language LearningTeacher RecommendationAPI Gateway