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

@aigne/example-mcp-server-github-integrator

v1.0.0

Published

A demonstration of using AIGNE Framework and GitHub MCP Server to interact with GitHub repositories

Readme

GitHub MCP Server Integration

This is a demonstration of using AIGNE Framework and GitHub MCP Server to interact with GitHub repositories.

flowchart LR

in(In)
out(Out)
agent(AI Agent)
github(GitHub MCP Agent)
searchRepos(Search Repositories)
getContents(Get Contents)
createFile(Create/Update File)
issue(Issues & PRs)

in --> agent <--> github

subgraph MCP Agent
  github <--> searchRepos
  github <--> getContents
  github <--> createFile
  github <--> issue
end

agent --> out

classDef inputOutput fill:#f9f0ed,stroke:#debbae,stroke-width:2px,color:#b35b39,font-weight:bolder;
classDef processing fill:#F0F4EB,stroke:#C2D7A7,stroke-width:2px,color:#6B8F3C,font-weight:bolder;

class in inputOutput
class out inputOutput
class agent processing
class github processing
class searchRepos processing
class getContents processing
class createFile processing
class issue processing

Following is a sequence diagram of the workflow to search for repositories and access contents:

sequenceDiagram
participant User
participant AI as AI Agent
participant G as GitHub MCP Agent
participant SR as Search Repositories
participant GC as Get Contents

User ->> AI: Search for repositories related to 'modelcontextprotocol'
AI ->> G: Use search_repositories function
G ->> SR: Execute search with query='modelcontextprotocol'
SR ->> G: Return repository list results
G ->> AI: Formatted repository information
AI ->> User: Found these repositories: modelcontextprotocol/servers, etc.
User ->> AI: Get README from the servers repo
AI ->> G: Use get_file_contents function
G ->> GC: Access README.md in modelcontextprotocol/servers
GC ->> G: Return file content
G ->> AI: Formatted file content
AI ->> User: Here's the README content: ...

Prerequisites

Try without Installation

export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # Setup your OpenAI API key
export GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_TOKEN # Setup your GitHub token

npx -y @aigne/example-mcp-server-github # Run the example

Installation

Clone the Repository

git clone https://github.com/AIGNE-io/aigne-framework

Install Dependencies

cd aigne-framework/examples/mcp-server-github-integrator

pnpm install

Setup Environment Variables

Setup your API keys in the .env.local file:

OPENAI_API_KEY="" # Your OpenAI API key
GITHUB_PERSONAL_ACCESS_TOKEN="" # Your GitHub Personal Access Token

Run the Example

pnpm start # Interactive chat interface
# or
pnpm example # Run predefined examples

Example

The following example demonstrates how to use the GitHub MCP server to search for repositories:

import {
  AIAgent,
  OpenAIChatModel,
  ExecutionEngine,
  MCPAgent,
} from "@aigne/core";

// Load environment variables
const { OPENAI_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN } = process.env;

// Initialize OpenAI model
const model = new OpenAIChatModel({
  apiKey: OPENAI_API_KEY,
});

// Initialize GitHub MCP agent
const githubMCPAgent = await MCPAgent.from({
  command: "npx",
  args: ["-y", "@modelcontextprotocol/server-github"],
  env: {
    GITHUB_PERSONAL_ACCESS_TOKEN,
  },
});

// Create execution engine
const engine = new ExecutionEngine({
  model,
  tools: [githubMCPAgent],
});

// Create AI agent with GitHub-specific instructions
const agent = AIAgent.from({
  instructions: `\
## GitHub Interaction Assistant
You are an assistant that helps users interact with GitHub repositories.
You can perform various GitHub operations like:
1. Searching repositories
2. Getting file contents
3. Creating or updating files
4. Creating issues and pull requests
5. And many more GitHub operations

Always provide clear, concise responses with relevant information from GitHub.
`,
});

// Example: Search for repositories
const result = await engine.call(
  agent,
  "Search for repositories related to 'modelcontextprotocol'",
);

console.log(result.text);
// Output:
// I found several repositories related to 'modelcontextprotocol':
//
// 1. **modelcontextprotocol/servers** - MCP servers for various APIs and services
// 2. **modelcontextprotocol/modelcontextprotocol** - The main ModelContextProtocol repository
// ...

// Shutdown the engine when done
await engine.shutdown();

Available GitHub Operations

The GitHub MCP server provides a wide range of operations including:

  1. Repository Operations:

    • Search repositories
    • Create repositories
    • Get repository information
  2. File Operations:

    • Get file contents
    • Create or update files
    • Push multiple files in a single commit
  3. Issue and PR Operations:

    • Create issues
    • Create pull requests
    • Add comments
    • Merge pull requests
  4. Search Operations:

    • Search code
    • Search issues
    • Search users
  5. Commit Operations:

    • List commits
    • Get commit details

License

This project is licensed under the MIT License.