mcps and skills

This commit is contained in:
2026-08-11 00:42:46 +03:00
parent 6ffb24f20a
commit 4e67077e12
44 changed files with 2158 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
namespace Database\Factories;
use App\Models\McpServer;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<McpServer>
*/
class McpServerFactory extends Factory
{
/**
* @return array<string, mixed>
*/
public function definition(): array
{
$name = fake()->unique()->company().' MCP';
$categories = array_keys(config('mcp_servers.categories'));
return [
'name' => $name,
'slug' => Str::slug($name),
'description' => fake()->paragraph(),
'url' => fake()->url(),
'docs_url' => fake()->url(),
'logo_url' => 'https://picsum.photos/seed/'.Str::slug($name).'/200',
'category' => fake()->randomElement($categories),
'install_command' => 'npx -y '.Str::slug($name),
'config_example' => json_encode(['mcpServers' => [Str::slug($name) => ['command' => 'npx', 'args' => ['-y', Str::slug($name)]]]], JSON_PRETTY_PRINT),
'transport' => fake()->randomElement(['stdio', 'sse', 'http']),
'language' => fake()->randomElement(['TypeScript', 'Python', 'Go']),
'capabilities' => fake()->sentences(3),
'tags' => fake()->randomElements(['open-source', 'official', 'read-only', 'requires-api-key'], rand(1, 3)),
'views' => fake()->numberBetween(0, 5000),
'clicks' => fake()->numberBetween(0, 500),
'featured' => false,
'approved' => true,
];
}
public function featured(): static
{
return $this->state(fn () => ['featured' => true]);
}
public function pending(): static
{
return $this->state(fn () => ['approved' => false]);
}
}
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace Database\Factories;
use App\Models\Skill;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<Skill>
*/
class SkillFactory extends Factory
{
/**
* @return array<string, mixed>
*/
public function definition(): array
{
$name = fake()->unique()->company().' Skill';
$categories = array_keys(config('skills.categories'));
return [
'name' => $name,
'slug' => Str::slug($name),
'description' => fake()->paragraph(),
'url' => fake()->url(),
'docs_url' => fake()->url(),
'logo_url' => 'https://picsum.photos/seed/'.Str::slug($name).'/200',
'category' => fake()->randomElement($categories),
'install_instructions' => 'Copy this skill folder into ~/.claude/skills/ (or add it via a plugin marketplace) and restart Claude.',
'example_prompt' => fake()->sentence(),
'requirements' => fake()->randomElement(['Claude Code', 'Claude with Code Execution tool', null]),
'tags' => fake()->randomElements(['official', 'community', 'anthropic', 'automation'], rand(1, 3)),
'views' => fake()->numberBetween(0, 5000),
'clicks' => fake()->numberBetween(0, 500),
'featured' => false,
'approved' => true,
];
}
public function featured(): static
{
return $this->state(fn () => ['featured' => true]);
}
public function pending(): static
{
return $this->state(fn () => ['approved' => false]);
}
}
@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('mcp_servers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->text('description');
$table->string('url');
$table->string('docs_url')->nullable();
$table->string('logo_url')->nullable();
$table->string('category');
$table->text('install_command')->nullable();
$table->text('config_example')->nullable();
$table->string('transport')->nullable();
$table->string('language')->nullable();
$table->json('capabilities')->nullable();
$table->json('tags')->nullable();
$table->unsignedInteger('views')->default(0);
$table->unsignedInteger('clicks')->default(0);
$table->boolean('featured')->default(false);
$table->boolean('approved')->default(false);
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
$table->timestamps();
$table->index(['category']);
$table->index(['approved', 'featured']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mcp_servers');
}
};
@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('skills', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->text('description');
$table->string('url');
$table->string('docs_url')->nullable();
$table->string('logo_url')->nullable();
$table->string('category');
$table->text('install_instructions')->nullable();
$table->text('example_prompt')->nullable();
$table->string('requirements')->nullable();
$table->json('tags')->nullable();
$table->unsignedInteger('views')->default(0);
$table->unsignedInteger('clicks')->default(0);
$table->boolean('featured')->default(false);
$table->boolean('approved')->default(false);
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
$table->timestamps();
$table->index(['category']);
$table->index(['approved', 'featured']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('skills');
}
};