# Generate Codeful MCP Tool

Generate a self-contained JavaScript server runtime and registration metadata for an...

- Repository: https://github.com/microsoft/power-platform-skills (1098 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -g -a claude-code -y`
Codex: `npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -g -a codex -y`
Cursor: `npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -g -a cursor -y`
Gemini CLI: `npx skills add microsoft/power-platform-skills --skill generate-codeful-mcp-tool -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add microsoft/power-platform-skills`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

**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
   whether any write creates, appends, updates, overwrites, or deletes state.
5. Whether the user also wants an MCP App widget.

Ask only for information that is missing. A sample input/output is preferred but not
mandatory when the user has supplied an equally precise contract.

## Phase 1: Read the runtime and metadata contracts

Read:

The rest: https://github.com/microsoft/power-platform-skills/blob/HEAD/plugins/mcp-apps/skills/generate-codeful-mcp-tool/SKILL.md
