npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codex-custom-mcp

v1.0.2

Published

MCP server for OpenAI Codex with conversation/session support

Readme

Codex MCP Server

自定义的 OpenAI Codex MCP 服务器,解决官方 MCP 不返回 conversationId 的问题。

功能

提供两个工具:

| 工具 | 功能 | 说明 | |------|------|------| | codex_run | 执行新任务 | 可选返回 conversationId | | codex_continue | 继续会话 | 使用之前的 conversationId |

安装

一条命令安装到 Claude Code:

claude mcp add codex-custom --scope user -- npx codex-custom-mcp

验证安装:

claude mcp list

卸载:

claude mcp remove codex-custom

使用方式

1. 简单任务(和官方一样)

codex_run: { prompt: "计算 1+1" }
→ "2"

2. 需要后续继续的任务

加上 return_conversation_id: true 参数:

codex_run: {
  prompt: "记住这个单词:APPLE",
  return_conversation_id: true
}
→ "好的,我记住了。\n\n---\nconversationId: 019b7863-5522-7750-9646-1ba7461efc97"

3. 继续对话

使用之前返回的 conversationId

codex_continue: {
  conversation_id: "019b7863-5522-7750-9646-1ba7461efc97",
  prompt: "你记住的单词是什么?"
}
→ "APPLE"

工具参数详解

codex_run

| 参数 | 类型 | 必填 | 默认值 | 说明 | |------|------|------|--------|------| | prompt | string | ✅ | - | 任务描述 | | model | string | ❌ | gpt-5.2 | 模型:gpt-5.2-codex(代码更强)、gpt-5.1-codex-maxgpt-5.2 | | cwd | string | ❌ | - | 工作目录路径 | | sandbox | enum | ❌ | danger-full-access | 沙箱模式:read-only, workspace-write, danger-full-access | | approval_policy | enum | ❌ | never | 审批策略:untrusted, on-failure, on-request, never | | return_conversation_id | boolean | ❌ | false | 是否返回 conversationId |

codex_continue

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | conversation_id | string | ✅ | 之前返回的会话 ID | | prompt | string | ✅ | 继续的任务描述 |

项目结构

codex-mcp-server/
├── src/
│   └── index.ts      # MCP 服务器源码
├── dist/
│   └── index.js      # 编译后的代码
├── package.json
├── tsconfig.json
└── README.md

开发

# 开发模式(自动重新编译)
npm run dev

# 构建
npm run build

# 启动
npm start

注意事项

  1. 会话存储在内存中:MCP 服务器重启后,之前的会话会丢失,需要重新创建
  2. 无需 Git 仓库:已配置 skipGitRepoCheck: true,可在任意目录使用
  3. 重启生效:修改代码后需要重新 npm run build,然后重启 Claude Code 会话

与官方 MCP 的区别

| 特性 | 官方 codex mcp-server | 本项目 codex-custom | |------|------------------------|----------------------| | 返回 conversationId | ❌ 只在事件流中,最终响应不包含 | ✅ 可选返回 | | 响应格式 | 只有文本 | 文本 + 可选 conversationId | | Git 仓库要求 | 需要在 Git 仓库中 | 无需 |

依赖

  • @modelcontextprotocol/sdk - MCP SDK
  • @openai/codex-sdk - Codex SDK
  • zod - 参数验证