Skip to content

Instantly share code, notes, and snippets.

@mdwoicke
mdwoicke / README.md
Created June 2, 2025 02:49 — forked from jherr/README.md
Interacting With An MCP Server In The Terminal

Step 1. Start a server up in the terminal

uvx mcp-server-fetch

Step 2. Initialize it by copy and pasting this JSON-RPC invocation (and hit return)

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{"sampling":{},"roots":{"listChanged":true}},"clientInfo":{"name":"mcp-inspector","version":"0.12.0"}}}

Step 3. Notify the server that it's now initialized

@mdwoicke
mdwoicke / flight_server.py
Created May 10, 2025 17:20 — forked from janakiramm/flight_server.py
MCP Server for Real-Time Flight Information
import json
import os
import requests
import pytz
from datetime import datetime, timedelta
from typing import Any, Callable, Set, Dict, List, Optional
from mcp.server.fastmcp import FastMCP
# Create MCP server
mcp = FastMCP("Flight Server")
find: https://order.dominos.com/power/store-locator?s=${line1}&c=${line2}&type=${type}
method: GET
s: Street Address
c: City, State and/or Postal Code
type: Delivery or Carryout
store info: https://order.dominos.com/power/store/${storeID}/profile
method: GET
storeId: store id number
@mdwoicke
mdwoicke / eigen-mcp.ts
Created April 11, 2025 19:08 — forked from dabit3/eigen-mcp.ts
EigenLayer MCP Server Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import 'dotenv/config'
const server = new McpServer({
name: "EigenLayer AVS service",
version: "1.0.0",
});
@mdwoicke
mdwoicke / contemplative-llms.txt
Created January 13, 2025 14:52 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
import os
import chromadb
from chromadb.utils import embedding_functions
from langchain.text_splitter import RecursiveCharacterTextSplitter
import hashlib
import logging
from rich.logging import RichHandler
from rich.progress import Progress, SpinnerColumn, TextColumn
from rich.console import Console
from rich.panel import Panel
@mdwoicke
mdwoicke / sample.txt
Created August 26, 2024 21:03 — forked from vinodkiran/sample.txt
flowise DocStore public api
-- routes/documentstore/index.ts
// document store external routes
router.post('/load-store/:storeid/:loaderId', documentStoreController.uploadDocumentStoreFile)
router.post('/check-status/:uploadId', documentStoreController.checkUploadStatus)
-- constrollers/documentstore/index.ts
const uploadDocumentStoreFile = async (req: Request, res: Response, next: NextFunction) => {
try {
import os
os.environ["OPENAI_API_KEY"] = "XXX"
os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller(
routers=["mf"],
strong_model="gpt-4-1106-preview",
@mdwoicke
mdwoicke / rag_gemini.py
Created July 20, 2024 14:11 — forked from janakiramm/rag_gemini.py
Python code to implement RAG with Vertex AI Vector Search and Gemini Pro
# The previous part of this tutorial is at https://gist.github.com/janakiramm/55d2d8ec5d14dd45c7e9127d81cdafcd
from vertexai.language_models import TextEmbeddingModel
from google.cloud import aiplatform
import vertexai
from vertexai.preview.generative_models import GenerativeModel, Part
import json
import os
project=”YOUR_GCP_PROJECT”
@mdwoicke
mdwoicke / vector_search.py
Created July 20, 2024 14:10 — forked from janakiramm/vector_search.py
Python Code to create Vertex AI Vector Search Index and Deploying it.
###Enable Google Cloud APIs and login with your credentials
#gcloud services enable compute.googleapis.com aiplatform.googleapis.com storage.googleapis.com
#gcloud auth application-default login
###Install required Python modules
#pip install pypdf2
#pip install google-cloud-storage
#pip install google-cloud-aiplatform
#pip install jupyter