Skip to content
forked from dfinke/PSMCP

PSMCP turns your PowerShell scripts into intelligent, conversational services—zero YAML, zero APIs, zero headaches.

License

Notifications You must be signed in to change notification settings

luchezarno/PSMCP

 
 

Repository files navigation

alt text

PowerShell MCP - PSMCP

Transform your PowerShell scripts into intelligent, AI-driven services that respond to natural language. PowerShell Model Context Protocol (PSMCP) bridges the gap between your code and large language models, enabling seamless AI-human-code collaboration without complex configuration.

No YAML, no friction. Just prompts, tools, and instant execution. It's not automation. It's collaboration.

In Action

🔧 What you'll see:

☑️Using New-MCP to scaffold a working AI server

☑️Integration with GitHub Copilot in Agent Mode

☑️Live demo: Add a PowerShell function, restart the server, and the AI just knows

This isn’t just code—it’s a conversation.


Install PSMCP

Install-Module PSMCP 

New-MCP d:\temp\testMCP
code-insiders d:\temp\testMCP

Install VS Code

To use PSMCP effectively, you'll need VS Code v1.99.3 or later. Here's how to install it:

  1. Visit the VS Code download page
  2. Download the appropriate version for your operating system
  3. Run the installer and follow the on-screen instructions

Set up GitHub Copilot in VS Code

This guide walks you through setting up GitHub Copilot in Visual Studio Code. To use Copilot in VS Code, you need to have access to GitHub Copilot with your GitHub account.

GitHub Copilot Setup Guide

Getting Started with PSMCP

New MCP

Start by creating a new MCP server with a simple command. This scaffolds the necessary files and sets the stage for dynamic AI interaction.

alt text

Once initialized, you're ready to configure your MCP tools—no YAML, no fuss.

MCP JSON

The JSON file defines your available tools. In this example, we’re creating a simple Invoke-Addition function.

alt text

Clicking "Start" embeds the tool definition into the MCP config. Now it’s registered and ready to go.

After Clicking Start

With the tool registered, starting the server wires up everything under the hood.

alt text

The server is hot and listening. Now you can talk to your code like it’s a teammate.

Let's Prompt

Time to interact. Drop a natural language prompt and let the AI figure out which function to use.

alt text

Your intent is recognized—and the AI knows exactly what tool to invoke.

Copilot Wants to Run your function

Copilot steps in, proposing to call your registered function based on your prompt.

alt text

Confirm to execute and let the AI orchestrate the rest.

Expand the Run

Peek under the hood—see the actual arguments passed to your function.

alt text

Confirm to execute and let the AI orchestrate the rest.

After Run

Execution complete. The function ran with your inputs, and now you get the result.

alt text

This isn’t just code—it’s a conversation. One prompt, one response, and a world of automation opens up.

Creating your own Functions

Edit the <yourMCPServerName.ps1> file adding your functions.

TIPS:

  • Write Help/Comments for your functions that describes what the function does, example(s) and outputs. This will help your MCP Client discover the capabilities and use the functions how you intended.
  • Make your Functions Global. (e.g. functionName Global:Get-myFunction {})
  • At the bottom of your <yourMCPServerName.ps1> add each function comma seperated so that they will be availabile in your MCP Client (e.g. VSCode)

alt text

🟨 Conclusion This workflow redefines how we build and run tools. From scaffolding an MCP server to interacting with it using plain language, the line between prompt and program is disappearing.

No more brittle glue code. No more hand-rolling APIs. Just describe what you want, and your AI-enhanced PowerShell server takes it from there—registering, invoking, and summarizing functions on demand.

Welcome to the future of coding. It’s not just execution—it’s collaboration.

Using Templates

PSMCP allows you to start your MCP server project from predefined templates using the -template parameter with the New-MCP command. Templates provide a quick starting point with common configurations or specific functionalities.

To use a template, simply specify its name when creating your MCP project:

# Example using the 'youtube' template
New-MCP -Path d:\\mygit\\MyYouTubeMCP -template youtube

This command will create a new MCP project in the specified path, using the youtube.template.ps1 file as the basis for your MCPServer.ps1.

Available templates include:

  • server: The default template, providing a basic server setup with an Invoke-Addition example function.
  • youtube: A template pre-configured for interacting with YouTube (requires the PSAI module).

You can explore the available templates in the template/ directory of the PSMCP module installation.

Contributing to PSMCP

Contributions are welcomed from the community! Whether you're fixing bugs, adding features, improving documentation, or sharing examples, your help makes PSMCP better.

How to Contribute

  1. Fork the repository - Create your own copy of the project to work with
  2. Create a branch - Make your changes in a new branch
  3. Submit a pull request - Once you're happy with your changes, submit a PR for review
  4. Discuss and review - Collaborate with maintainers to refine your contribution
  5. Get merged - Once approved, your changes will become part of PSMCP

Types of Contributions We're Looking For

  • Bug fixes and issue reports
  • New features and enhancements
  • Documentation improvements
  • Example scripts and usage scenarios
  • Performance optimizations

Please ensure your code follows the project's style and includes appropriate tests.

For changes, please open an issue first to discuss what you would like to change.

Thank you to all our contributors who help make PSMCP better!

About

PSMCP turns your PowerShell scripts into intelligent, conversational services—zero YAML, zero APIs, zero headaches.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%