NOC.McpServer

io.github.nice-one-code由 GitHub 帳號 nice-one-code 發布v1.0.7更新於 Oct 24, 2026

MCP server exposing NiceOneCode's JSON-to-C# converter as an AI-callable tool.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,透過 NiceOneCode 的轉換器,讓助理把 JSON 範例轉成 C# 類別定義。

可以做什麼
JSON 轉 C#:把 JSON 範例傳給 json_to_c_sharp 工具,取回由 NiceOneCode 轉換器產生的等效 C# 類別定義。
適用情境
當你手邊有 JSON 請求內容、API 回應或設定範例,想直接產生 C# 模型類別、而不必把 JSON 貼到網頁表單時使用。
執行需求
以 .NET 工具形式從 NuGet 安裝並在本機透過 stdio 執行;需要 .NET 9 SDK(若用 dnx 一次性執行則需 .NET 10 SDK)。需要 NiceOneCode 帳號,透過 NOC_USERID 與 NOC_PASSWORD 環境變數提供,並需要連線到 NiceOneCode 服務的網路。
安裝前請注意
需要在 NOC_PASSWORD 中提供 NiceOneCode 帳號密碼;伺服器首次使用時會登入並快取 JWT,請勿把憑證寫進提交的設定檔。JSON 範例會傳送到 NiceOneCode 的遠端轉換器,避免送出機密資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 NOC.McpServer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

NOC.McpServer

An MCP (Model Context Protocol) server that exposes NiceOneCode's JSON → C# class converter as a tool AI assistants can call directly — no more pasting JSON into a web form.

Built with the official ModelContextProtocol C# SDK, running over stdio transport. Published on NuGet.org under the McpServer package type.

What it does

Exposes a single tool, json_to_c_sharp, which takes a JSON sample and returns the equivalent C# class definitions, generated by NiceOneCode's converter.

Authentication is handled transparently: the server logs in to your NiceOneCode account on first use, caches the JWT, and automatically re-authenticates if it expires.

Prerequisites

  • A NiceOneCode account (userid + password)
  • .NET 9 SDK or later, to install/run the tool
  • .NET 10 SDK if you want to use dnx (VS Code, one-shot execution) instead of a persistent install
  • .NET 9 SDK specifically if building from source

Creating an Account

If you don't already have a NiceOneCode account, you can register one via API:

bash
curl -X POST \  --header 'Content-Type: application/json' \  --header 'Accept: application/json' \  -d '{    "UserName": "your-username",    "Password": "your-password",    "Email": "[email protected]",    "GenderID": 1  }' \  'https://www.niceonecode.com/api/nc-register'
FieldDescription
UserNameDesired username
PasswordDesired password — use this as NOC_PASSWORD
EmailA valid email address
GenderID1 = Male, 2 = Female

Important: the response body is a plain string, not a JSON object — for example:

json
"your-userid"

Use this returned value as NOC_USERID (not necessarily assumed to always match the UserName you submitted — always use the value the API actually returns, rather than the value you sent).

Install

bash
dotnet tool install -g NOC.McpServer

This gives you the noc-mcp command, used in every client config below.

Configuration

The server reads two required environment variables:

VariableDescription
NOC_USERIDYour NiceOneCode userid
NOC_PASSWORDYour NiceOneCode password

Never commit real credentials. Set them via your MCP client's config (see below) or your local shell environment.

Connecting to an MCP client

Claude Desktop

Edit claude_desktop_config.json (Windows: %APPDATA%\Claude\claude_desktop_config.json, macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "niceonecode": {      "command": "noc-mcp",      "env": {        "NOC_USERID": "your-userid",        "NOC_PASSWORD": "your-password"      }    }  }}

Fully quit and reopen Claude Desktop after editing.

Claude Code

bash
claude mcp add-json niceonecode '{"command":"noc-mcp","env":{"NOC_USERID":"your-userid","NOC_PASSWORD":"your-password"}}'

Verify with claude mcp list.

Codex

bash
codex mcp add niceonecode --env NOC_USERID=your-userid --env NOC_PASSWORD=your-password -- noc-mcp

Verify inside a session with /mcp.

VS Code

Add to .vscode/mcp.json in your workspace, or your global VS Code MCP settings:

json
{  "inputs": [    {      "type": "promptString",      "id": "NOC_USERID",      "description": "Your NiceOneCode account userid"    },    {      "type": "promptString",      "id": "NOC_PASSWORD",      "description": "Your NiceOneCode account password",      "password": true    }  ],  "servers": {    "NOC.McpServer": {      "type": "stdio",      "command": "dnx",      "args": ["NOC.McpServer", "--yes"],      "env": {        "NOC_USERID": "${input:NOC_USERID}",        "NOC_PASSWORD": "${input:NOC_PASSWORD}"      }    }  }}

VS Code will prompt for your userid and password the first time the server starts. Requires the .NET 10 SDK for dnx, which downloads and runs the latest published version on demand — no separate install step needed. Pin a specific version with "[email protected]" instead of "NOC.McpServer" if you want reproducible behavior rather than always-latest.

Note: a global.json in your working directory pinning an SDK below .NET 10 will cause dnx to fail with a confusing "unrecognized argument" error rather than a clear version mismatch — check for one if this happens.

Gemini CLI

Edit ~/.gemini/settings.json (global) or .gemini/settings.json (project-specific):

json
{  "mcpServers": {    "niceonecode": {      "command": "noc-mcp",      "env": {        "NOC_USERID": "your-userid",        "NOC_PASSWORD": "your-password"      }    }  }}

Restart Gemini CLI, then run /mcp to confirm it's connected.

Windows note: if the server fails to start directly, wrap it through cmd:

json
{  "mcpServers": {    "niceonecode": {      "command": "cmd",      "args": ["/c", "noc-mcp"],      "env": { "NOC_USERID": "your-userid", "NOC_PASSWORD": "your-password" }    }  }}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json (macOS/Linux) or %USERPROFILE%\.codeium\windsurf\mcp_config.json (Windows), or open it via the MCPs icon in the Cascade panel → Configure:

json
{  "mcpServers": {    "niceonecode": {      "command": "noc-mcp",      "env": {        "NOC_USERID": "your-userid",        "NOC_PASSWORD": "your-password"      }    }  }}

Fully quit and reopen Windsurf after saving.

Devin

Devin (cloud): Settings → Connections → MCP servers → Add a custom MCP:

json
{  "transport": "STDIO",  "command": "noc-mcp",  "args": [],  "env_variables": {    "NOC_USERID": "your-userid",    "NOC_PASSWORD": "your-password"  }}

Devin for Terminal: add to .devin/config.json:

json
{  "mcpServers": {    "niceonecode": {      "command": "noc-mcp",      "env": {        "NOC_USERID": "your-userid",        "NOC_PASSWORD": "your-password"      }    }  }}

Devin Desktop shares Windsurf's mcp_config.json — no separate setup needed if already configured above.

Building from source

If you'd rather build locally instead of installing from NuGet:

bash
git clone https://github.com/nice-one-code/NOC.McpServer.gitcd NOC.McpServerdotnet build

Then point any client above at the compiled DLL instead of noc-mcp, e.g. for Claude Desktop:

json
{  "mcpServers": {    "niceonecode": {      "command": "dotnet",      "args": ["/absolute/path/to/NOC.McpServer/bin/Debug/net9.0/NOC.McpServer.dll"],      "env": {        "NOC_USERID": "your-userid",        "NOC_PASSWORD": "your-password"      }    }  }}

Use forward slashes in the path even on Windows. The same substitution (dotnet + DLL path in place of noc-mcp) applies to any client config in this README.

Testing locally with the MCP Inspector

bash
npx @modelcontextprotocol/inspector dotnet bin/Debug/net9.0/NOC.McpServer.dll

This opens a browser UI where you can invoke json_to_c_sharp manually and inspect the raw request/response. Set your credentials under the Inspector's Environment Variables panel before connecting.

Project structure

來源:README.md,提交 0da867e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.7最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分