Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Concurrent MCP OAuth token saves can lose credentials

Abierto
#146 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript

Línea de trabajo

The issue is in packages/coding-agent/src/step/mcp-oauth.ts. Look at the saveTokens method and the publish function. The repo already uses proper-lockfile for auth.json; examine how that lock is implemented. You'll need to apply a similar cross-process lock around the read-modify-write sequence for .credentials.json. Create a unique temporary file for the write before the atomic rename. Test by simulating concurrent OAuth token saves from two Step processes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

untriaged
What happened?

MCP OAuth token updates use an unlocked read-modify-write of .credentials.json. Both createStoredMcpOAuthProvider().saveTokens() and loginMcpServer().saveTokens() load the whole store, change one server entry, then rename a replacement file. Two Step processes saving different servers can both read the same old store; the second rename drops the first process's new token.

Steps to reproduce

Use one config root with two MCP servers and run two Step processes. Trigger both OAuth token saves concurrently. If both processes read the store before either rename, the final file contains only the update from the last writer. The relevant read/update and publish paths are synchronous but unguarded across processes.

Expected behavior

Lock the credential store across processes around reload, update, and publish, then release in finally. This repo already uses proper-lockfile for auth.json; its documented lock API supports retries and realpath: false for a missing target. The MCP SDK awaits saveTokens, so the provider can use an async lock. Use a unique temporary path for publication.

Version

main @ cb5fc1456d49d49c62e072bfed2926220083214e

AI-assisted report; source path checked against the stated commit.

Lenguaje dominante
TypeScript
Estrellas
654
Forks
55
Merge medio
1 d 12 h
PR fusionados (30 d)
43

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stepfun-ai/Step-Code

Todos los issues de stepfun-ai/Step-Code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.