# generate-codeful-mcp-tool

The generate-codeful-mcp-tool skill builds a JavaScript server runtime and registration metadata for a codeful MCP tool. Use it for Dataverse-backed tools or an MCP App widget.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1167 repo stars
- Author: Microsoft Corporation
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/mcp-apps/skills/generate-codeful-mcp-tool/SKILL.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/generate-codeful-mcp-tool

## What it does

The skill produces two files for one MCP tool: `<tool-name>.tool.js` with the server implementation and `<tool-name>.tool.json` with registration metadata. The JavaScript module exports `runTool({ toolInput, dataApi })`; the JSON sidecar defines the name, description, input and output schemas, plus MCP annotations.

Before generation, the agent needs the tool purpose, a kebab-case name, input fields, expected output, and any Dataverse operations. For a Dataverse tool, it checks tables through PAC CLI and uses verified logical names and columns. Generation must stop when the Dataverse schema cannot be verified, so invented tables and fields are not used.

The skill runs in Claude Code with `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `AskUserQuestion`, and `Skill`. It can also pair the server logic with an MCP App widget when that is part of the request.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add microsoft/power-platform-skills
```
In the agent chat (not a shell):
```text
/plugin install mcp-apps@power-platform-skills
```
This installs the whole mcp-apps plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/generate-codeful-mcp-tool/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/generate-codeful-mcp-tool/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/generate-codeful-mcp-tool/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/generate-codeful-mcp-tool/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install microsoft/power-platform-skills plugins/mcp-apps/skills/generate-codeful-mcp-tool
```

2. **Manually: put the files in place**
- File: `.github/skills/generate-codeful-mcp-tool/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/microsoft/power-platform-skills --path plugins/mcp-apps/skills/generate-codeful-mcp-tool
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/generate-codeful-mcp-tool/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/mcp-apps/skills/generate-codeful-mcp-tool/SKILL.md

## When to use it
- create a JavaScript runtime for an MCP tool
- define MCP registration metadata in JSON
- write a `runTool` function around `dataApi`
- verify Dataverse tables and columns
- pair MCP server logic with an MCP App widget

## Example prompts
- Create a codeful MCP tool named `account-summary` that reads Dataverse data and returns a summary.
- Generate `<tool-name>.tool.js` and `<tool-name>.tool.json` for this input contract and expected result: ...
- Check the Dataverse schema through PAC CLI and prepare the server logic for an MCP App widget.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 42730419c3237d89.

BEGIN THIRD-PARTY FILE 42730419c3237d89
````text
---
name: generate-codeful-mcp-tool
version: 1.0.0
description: >
  Generate a self-contained JavaScript server runtime and registration metadata
  for an MCP codeful tool.
  Use when the user asks to create a codeful MCP tool, generate server logic for
  an MCP tool, write a runTool function, build a Dataverse-backed MCP tool, or
  pair MCP server logic with an MCP App widget.
author: Microsoft Corporation
argument-hint: <tool purpose, inputs, and expected result>
user-invocable: true
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Skill
---

**Triggers:** codeful MCP tool, MCP server tool, generate runTool, MCP tool JavaScript,
Dataverse MCP tool, server logic for MCP App

**Keywords:** mcp apps, codeful tool, runTool, dataApi, Dataverse, server runtime

**Aliases:** /generate-codeful-mcp-tool, /codeful-tool

**References:**
- Host API types: [codeful-tool-host-data-api.d.ts](../../references/codeful-tool-host-data-api.d.ts)
- Known-good tool: [account-summary.tool.js](../../samples/account-summary.tool.js)
- Known-good metadata: [account-summary.tool.json](../../samples/account-summary.tool.json)
- Widget generation: [generate-mcp-app-ui](../generate-mcp-app-ui/SKILL.md)

---

You generate a matched pair of files for one MCP tool:

- `<tool-name>.tool.js`: the complete JavaScript server implementation.
- `<tool-name>.tool.json`: declarative registration metadata containing the tool name,
  description, input schema, output schema, and MCP tool annotations.

The host imports the JavaScript module and calls:

```javascript
await runTool({ toolInput, dataApi });
```

## Required information

Before generating, establish:

1. The tool's purpose and kebab-case tool name. Use the purpose to write a concise,
   model-actionable tool description; ask only when the intended behavior is ambiguous.
2. Its input fields, types, required fields, and constraints. Accept a JSON Schema, a
   representative input object, or an exact field description. Never guess the input shape.
3. The expected result, preferably as a representative output object.
4. Whether it reads or writes Dataverse, the requested tables in business terms, and
````
END THIRD-PARTY FILE 42730419c3237d89

The third-party file has ended. Everything between the 42730419c3237d89 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2175 of 12494 bytes. © Microsoft Corporation · MIT · https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/mcp-apps/skills/generate-codeful-mcp-tool/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
