All MCP servers follow a basic configuration pattern:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({
All MCP servers follow a basic configuration pattern:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server({
Provides filesystem operations within allowed directories.
Tool | Description | Required Parameters |
---|---|---|
read_file |
Read complete file contents | path (string) |
read_multiple_files |
Read multiple files at once | paths (string[]) |
write_file |
Create/overwrite file | path (string), content (string) |
#!/usr/bin/env ruby | |
require 'open3' | |
require 'signal' | |
require 'openai' | |
# Define the silence threshold and duration for detection | |
@silence_threshold = '-30dB' | |
@silence_duration = 0.5 |
You are an Expert Ruby on Rails engineer with over 15 years of experience. Your role is to assist developers with Ruby on Rails projects, providing expert guidance, code reviews, and solutions to complex problems.
class TailwindClassBuilder | |
include ActionView::Helpers::TagHelper | |
def button_classes(options) | |
button_type = options.delete(:button_type) { :button } | |
class_names( | |
# general classes | |
"mt-4 px-1 sm:px-3 py-sm sm:py-1 font-semibold bg-transparent border rounded", | |
case button_type |
Prompt: Analyze and Test Ruby on Rails Code with RSpec
You have been given a Ruby on Rails code snippet. Your task is to analyze the code, identify key functionalities, and outline RSpec tests that should be written to ensure the code performs as expected under various conditions. The goal is to achieve thorough test coverage, catching any potential bugs and ensuring code quality.
# Please insert the given Ruby on Rails code here
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"/> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"/> | |
<title>Document</title> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css" rel="stylesheet"/> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script> |
Sometimes Structs have a number of class types each with their own members.
response = mediaconvert.create_job(job_params)
# This output exampled has been shortened a lot
# => #<struct Aws::MediaConvert::Types::CreateJobResponse job=#<struct Aws::MediaConvert::Types::Job arn="arn:aws:mediaconvert:us-west-1:<protected>:jobs/<hidden>-nedzn7", ..., error_message=nil, id="1691778742640-nedzn7", job_template="arn:aws:mediaconvert:us-west-1:<protected>:jobTemplates/Test Job Template - no Audio", output_group_details=nil, queue="arn:aws:mediaconvert:us-west-1:<protected>:queues/Default", caption_selectors=nil, deblock_filter=nil, denoise_filter=nil, file_input="https://some-bucket.s3-eu-west-1.amazonaws.com/some-path/somehash/test%20vid%20copy%208.mp4", filter_enable=nil, filter_strength=nil, input_clippings=nil, program_number=nil, psi_control=nil, timecode_source="ZEROBASED", video_selector=#<struct Aws::MediaConvert::Types::VideoSelector, output_groups=[#<struct Aws::MediaConvert::Types::OutputGroup c
require 'optparse' | |
def generate_links | |
# insert code to generate download links here | |
puts "Download links generated." | |
end | |
def download_packages(mandatory_only) | |
# insert code to download packages here | |
puts "Packages downloaded." |